Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
Receive_and_Decrypt.s
Log onto an FTP site, receive a specific file, decrypt it while renaming it to a .txt, and finally log off the server. This script also demonstrates some techniques for issuing error handling commands.
1 ;;
2 ;; Logon to FTP site
3 ;;
4 FTPLOGON "IP Address" /user=username /pw=password
5 IFERROR= $ERROR_SUCCESS GOTO Operation1
6 GOTO Disconnect
7 ;;
8 ;; Receive encrypted file from FTP site
9 ;;
10 :Operation1
11 RCVFILE "encryptedfile.gpg"
12 IFERROR= $ERROR_SUCCESS GOTO Operation2
13 GOTO Disconnect
14 ;;
15 ;; Decrypt received file
16 ;;
17 :Operation2
18 PGPDECRYPT "encryptedfile.gpg" "decryptedfile.txt" /pw=keypassphrase
19 IFERROR= $ERROR_SUCCESS GOTO Disconnect
20 ;;
21 ;; Logoff to FTP Site
22 ;;
23 :Disconnect
24 FTPLOGOFF

