Commit 834d94be authored by Fjen Undso's avatar Fjen Undso
Browse files

add support for different server ports

parent 496d7b1e
......@@ -27,8 +27,9 @@ declare -r EXLUDEDBS='^(?!(mysql|phpmyadmin|information_schema|performance_schem
declare -r FTPHOST="example.com"
declare -r FTPUSER=""
declare -r FTPPASS=""
declare -r FTPTYPE="sftp" # ftp, ftps, sftp - leave empty if not desired
declare -r FTPPORT="" # leave empty for standard protocol port
declare -r FTPDIR="path/on/ftp"
declare -r FTPTYPE="sftp" # ftp or sftp - leave empty if not desired
declare -r FTPNUMBACKUPS=90
### gpg settings
declare -r GPGPASS="" # optional gpg symmetrical passphrase
......@@ -49,7 +50,11 @@ fail() {
}
execftp() {
lftp -u $FTPUSER,$FTPPASS $FTPTYPE://$FTPHOST -e "$1" 2> /dev/null
if [ -n "$FTPPORT" ]; then
lftp -p $FTPPORT -u $FTPUSER,$FTPPASS $FTPTYPE://$FTPHOST -e "$1" 2> /dev/null
else
lftp -u $FTPUSER,$FTPPASS $FTPTYPE://$FTPHOST -e "$1" 2> /dev/null
fi
[ $? -ge 1 ] \
&& fail "Error: ftp command failed: $1"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment