From 9d007a67ca5b8cf69d680acb3799517e6164cc40 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 24 May 2019 00:30:34 -0600 Subject: [PATCH] func badParam: reorder and add bad service --- backup_new.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backup_new.sh b/backup_new.sh index 0bb2907..76c0e8d 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -20,14 +20,18 @@ mag="\e[95m" # bad parameter passed to script badParam () { - if [ "$1" = "empty" ]; then - printf "${err}\nError: '%s' cannot have a NULL (empty) value.\n" "$2" - printf "${cyan}Please use '--help' for assistance${norm}\n\n" - exit 1 - elif [ "$1" = "dne" ]; then + if [ "$1" = "dne" ]; then printf "${err}\nError: '%s %s'\n" "$2" "$3" printf "file or directory does not exist.${norm}\n\n" exit 1 + elif [ "$1" = "empty" ]; then + printf "${err}\nError: '%s' cannot have a NULL (empty) value.\n" "$2" + printf "${cyan}Please use '--help' for assistance${norm}\n\n" + exit 1 + elif [ "$1" = "svc" ]; then + printf "${err}\nError: '%s %s': Service does not exist!${norm}\n\n" \ + "$2" "$3" + exit 1 elif [ "$1" = "user" ]; then printf "${err}\nError: '%s %s': User does not exist!${norm}\n\n" \ "$2" "$3"