Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ============================================================================
- # @file ftpsh
- # @brief Script to execute command line arguments as FTP command
- # @author Tamas Dezso <dezso.t.tamas@gmail.com>
- # @date November 8, 2017
- # ============================================================================
- if [ $# -lt 1 ]
- then
- echo -e "\n Usage: $0 <ftp-command> [argument(s)]\n"
- exit 1
- fi
- HOST=hostname.com
- USER=username
- PASS=password
- DIR=/home/$USER
- echo "ftp://$USER@$HOST:$DIR$ $@"
- ftp -in $HOST <<EOF
- user ${USER} ${PASS}
- cd ${DIR}
- bin
- $@
- bye
- EOF
- exit $?
Add Comment
Please, Sign In to add comment