From b94d4e72e4f20791401ed73fe551dfad3ccdd694 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Thu, 3 Aug 2017 21:55:08 +0200 Subject: [PATCH] fix: minor fixes for ssh and package options --- backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup.sh b/backup.sh index 616978d..af9b46b 100755 --- a/backup.sh +++ b/backup.sh @@ -52,7 +52,7 @@ function backup () { $ECHO "Creating backup in \"$TOSSH:$TARGET$1\"..." | formatLog >> $LOG - if [ "$LISTPACKAGES" ] && [ -z "$FROMSSH" ]; then + if [ -n "$LISTPACKAGES" ] && [ -z "$FROMSSH" ]; then $ECHO "$DPKG --get-selections | $AWK '!/deinstall|purge|hold/'|$CUT -f1 | $TR '\n' ' '" | formatLog >> $LOG $DPKG --get-selections | $AWK '!/deinstall|purge|hold/'|$CUT -f1 |$TR '\n' ' ' | formatLog >> $LOG 2>&1 fi @@ -75,13 +75,13 @@ function backup () # Backup files for SOURCE in "${SOURCES[@]}" do - if [ -n $"S" ] && [ -n "$TOSSH" ] && [ -z "$FROMSSH" ]; then + if [ -n "$S" ] && [ -n "$TOSSH" ] && [ -z "$FROMSSH" ]; then $ECHO "$RSYNC -e \"$S\" -avR \"$SOURCE\" ${RSYNCCONF[@]} \"$TOSSH:$TARGET$1\" $INC " | formatLog >> $LOG $RSYNC -e "$S" -avR "$SOURCE" "${RSYNCCONF[@]}" "$TOSSH:\"$TARGET\"$1" $INC --exclude-from=$EXCLUDEFROM | formatLog >> $LOG 2>&1 if [ $? -ne 0 ]; then ERROR=1 fi - elif [ -n $"S" ] && [ -z "$TOSSH" ] && [ -n "$FROMSSH" ]; then + elif [ -n "$S" ] && [ -z "$TOSSH" ] && [ -n "$FROMSSH" ]; then $ECHO "$RSYNC -e \"$S\" -avR \"$FROMSSH:$SOURCE\" ${RSYNCCONF[@]} $TARGET$1 $INC" | formatLog >> $LOG $RSYNC -e "$S" -avR "$FROMSSH:\"$SOURCE\"" "${RSYNCCONF[@]}" "$TARGET"$1 $INC --exclude-from=$EXCLUDEFROM | formatLog >> $LOG 2>&1 if [ $? -ne 0 ]; then