From 05172002df749091ddc61405e6bfb30839242ffe Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Wed, 10 May 2023 15:23:54 -0700 Subject: [PATCH] getopts fixes --- bin/vhost.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/vhost.sh b/bin/vhost.sh index 78fd863..3c96634 100755 --- a/bin/vhost.sh +++ b/bin/vhost.sh @@ -57,7 +57,7 @@ function vhost::validate_domain () { function vhost:getoptions () { local OPTIND - while getopts "cd:i:m:o:p:u:jhnvwx:" opt ; do + while getopts "cd:i:m:o:p:u:j:hnvw:x:" opt ; do case "${opt}" in h ) # display help and exit help @@ -70,7 +70,7 @@ function vhost:getoptions () { domain=${OPTARG,,} if ! vhost::validate_domain $domain; then echo "ERROR: $domain is not a valid domain name." - exit + exit 1 fi ;; i ) # User ID (UID) for new user @@ -105,7 +105,7 @@ function vhost:getoptions () { w ) # write - store data in file write=${OPTARG} if [[ $write != "0" ]] && [[ $write != "1" ]]; then - echo "ERROR: Invalid write setting: -j $write" + echo "ERROR: Invalid write setting: -w $write" exit 1 fi ;;