From c080870f45b35ea072b7f467e3c88d0974617723 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Tue, 20 Dec 2016 21:59:02 +0900 Subject: [PATCH] update ftp command check --- backup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index 40e5213..e7cf326 100644 --- a/backup.sh +++ b/backup.sh @@ -99,7 +99,7 @@ log() { # Check for list of mandatory binaries check_commands() { # This section checks for all of the binaries used in the backup - BINARIES=( cat cd du date dirname echo openssl mysql mysqldump pwd rm tar ftp ) + BINARIES=( cat cd du date dirname echo openssl mysql mysqldump pwd rm tar ) # Iterate over the list of binaries, and if one isn't found, abort for BINARY in "${BINARIES[@]}"; do @@ -114,6 +114,14 @@ check_commands() { if [ "$(command -v "gdrive")" ]; then GDRIVE_COMMAND=true fi + + # check ftp command + if ${FTP_FLG}; then + if [ ! "$(command -v "ftp")" ]; then + log "ftp is not installed. Install it and try again" + exit 1 + fi + fi } calculate_size() {