Skip to content

Instantly share code, notes, and snippets.

@andmatand
Created April 21, 2013 03:52
Show Gist options
  • Save andmatand/5428395 to your computer and use it in GitHub Desktop.
Save andmatand/5428395 to your computer and use it in GitHub Desktop.
Upload a file (given as the sole argument) to an ftp server, without requiring user intervention.
#!/bin/sh
SERVER=example.com
USERNAME=username
PASSWORD=password
FILENAME=$1
echo -n "Uploading $1..."
ftp -n $SERVER <<End-Of-Session
user $USERNAME "$PASSWORD"
binary
put "$FILENAME"
bye
End-Of-Session
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment