Make error reporting more priminent
authorAlexander Barton <alex@barton.de>
Tue, 4 Aug 2015 12:46:05 +0000 (14:46 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 4 Aug 2015 12:46:05 +0000 (14:46 +0200)
bin/mkmysqldump

index 80c299e64d2faa070a4bbe4d31eaab01b9dd6985..cd0fac48db470ce56546782fbfdcbd0654620344 100755 (executable)
@@ -43,6 +43,12 @@ Usage() {
        exit 2
 }
 
+ErrorNotice() {
+       echo
+       echo "----->  THERE HAVE BEEN ERRORS!  <-----"
+       echo
+}
+
 for cmd in mysql mysqldump; do
        if ! which "$cmd" >/dev/null 2>&1; then
                echo "$NAME: \"$cmd\" command not found!"
@@ -118,6 +124,7 @@ DATABASES=$(
 )
 if [ $? -ne 0 ]; then
        echo "Failed to get list of databases! Aborting!"
+       ErrorNotice
        exit 1
 fi
 
@@ -150,9 +157,12 @@ if [ -n "$STATS" ]; then
        echo
 fi
 
-[ $r -eq 0 ] \
-       && echo "Dump command exited with code 0, success." \
-       || echo "Dump command FAILED with code $r!" >&2
+if [ $r -eq 0 ]; then
+       echo "Dump command exited with code 0, success."
+else
+       echo "Dump command FAILED with code $r!" >&2
+       ErrorNotice
+fi
 
 echo
 exit $r