From 385702b21aea71e805e57caf00caa415168ce197 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Thu, 3 Aug 2017 21:50:59 +0200 Subject: [PATCH] fix: small issue when sending mail and exit when to- and fromssh are set --- backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index ef3a464..616978d 100755 --- a/backup.sh +++ b/backup.sh @@ -131,6 +131,7 @@ elif [ -n "$TOSSH" ] && [ -n "$FROMSSH" ]; then ERROR=1 $ECHO "Plese don't provide to and from ssh information!" | formatLog >> $LOG $ECHO "No backup performed!" | formatLog >> $LOG + exit 1 fi # Get date etc. @@ -154,7 +155,7 @@ fi backup "daily/$WEEKDAY-$($DATE +"%A")/$HOUR" # Send email if an adress was provided -if [ -n MAILADRESS ]; then +if [ -n "$MAILADRESS" ]; then if [ $ERROR ]; then $MAIL -s "[Backup] error occured during backup - $LOG" $MAILADRESS < $LOG else