From b95981e4bb6b76663e38f63b5a4532528c690abf Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 27 May 2019 03:08:54 -0600 Subject: [PATCH] func badDetails for missing or invalid details --- backup_new.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backup_new.sh b/backup_new.sh index 2ca163f..39be447 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -17,6 +17,15 @@ mag=$(tput setaf 5) ### functions +# bad configuration value passed in details file +badDetails () { + if [ "$1" = "empty" ]; then + exitError 130 "details:${2} cannot be NULL (undefined)" + elif [ "$1" = "dne" ]; then + exitError 131 "details:${2} file or directory does not exist." + fi +} + # bad parameter passed to script badParam () { if [ "$1" = "dne" ]; then