Created
March 6, 2020 05:16
-
-
Save twinbird/d945cb234506d2a7a1cc9458f854fc7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#################################################################################################################### | |
# Upload by FTP | |
# NAME: | |
# send_ftp.sh | |
# SYNOPSIS: | |
# send_ftp.sh [FTP SERVER NAME] [FTP USER] [FTP PASSWORD] [SEND FILE PATH] [SEND REMOTE DIR] | |
#################################################################################################################### | |
SERVER=$1 | |
USER=$2 | |
PASS=$3 | |
FILE=`basename $4` | |
LOCAL_DIR=`dirname $4` | |
REMOTE_DIR=$5 | |
ftp -n <<END | |
open $SERVER | |
user $USER $PASS | |
lcd $LOCAL_DIR | |
mkdir $REMOTE_DIR | |
cd $REMOTE_DIR | |
binary | |
prompt | |
put $FILE | |
close | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment