func badParam: reorder and add bad service

This commit is contained in:
Asif Bacchus 2019-05-24 00:30:34 -06:00
parent ca0db04a3b
commit 9d007a67ca

View File

@ -20,13 +20,17 @@ mag="\e[95m"
# bad parameter passed to script # bad parameter passed to script
badParam () { badParam () {
if [ "$1" = "empty" ]; 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 "${err}\nError: '%s' cannot have a NULL (empty) value.\n" "$2"
printf "${cyan}Please use '--help' for assistance${norm}\n\n" printf "${cyan}Please use '--help' for assistance${norm}\n\n"
exit 1 exit 1
elif [ "$1" = "dne" ]; then elif [ "$1" = "svc" ]; then
printf "${err}\nError: '%s %s'\n" "$2" "$3" printf "${err}\nError: '%s %s': Service does not exist!${norm}\n\n" \
printf "file or directory does not exist.${norm}\n\n" "$2" "$3"
exit 1 exit 1
elif [ "$1" = "user" ]; then elif [ "$1" = "user" ]; then
printf "${err}\nError: '%s %s': User does not exist!${norm}\n\n" \ printf "${err}\nError: '%s %s': User does not exist!${norm}\n\n" \