Skip to content

Instantly share code, notes, and snippets.

@arnobroekhof
Created May 29, 2012 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnobroekhof/2831000 to your computer and use it in GitHub Desktop.
Save arnobroekhof/2831000 to your computer and use it in GitHub Desktop.
ftp with exit status
#!/bin/sh
/usr/bin/ftp -iv centos << EOF 2> ftp.error
binary
put testfile
quit
EOF
test -s ftp.error && echo "FTP failed" && exit 1 || rm -f ftp.error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment