fix: small issue when sending mail and exit when to- and fromssh are set

This commit is contained in:
Shannon Sterz 2017-08-03 21:50:59 +02:00
parent a4c7e48ca0
commit 385702b21a

View file

@ -131,6 +131,7 @@ elif [ -n "$TOSSH" ] && [ -n "$FROMSSH" ]; then
ERROR=1 ERROR=1
$ECHO "Plese don't provide to and from ssh information!" | formatLog >> $LOG $ECHO "Plese don't provide to and from ssh information!" | formatLog >> $LOG
$ECHO "No backup performed!" | formatLog >> $LOG $ECHO "No backup performed!" | formatLog >> $LOG
exit 1
fi fi
# Get date etc. # Get date etc.
@ -154,7 +155,7 @@ fi
backup "daily/$WEEKDAY-$($DATE +"%A")/$HOUR" backup "daily/$WEEKDAY-$($DATE +"%A")/$HOUR"
# Send email if an adress was provided # Send email if an adress was provided
if [ -n MAILADRESS ]; then if [ -n "$MAILADRESS" ]; then
if [ $ERROR ]; then if [ $ERROR ]; then
$MAIL -s "[Backup] error occured during backup - $LOG" $MAILADRESS < $LOG $MAIL -s "[Backup] error occured during backup - $LOG" $MAILADRESS < $LOG
else else