From b3cd92e8ff29aaabab4d89557af88c9d4fb6f8cc Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Wed, 17 May 2023 14:51:54 -0700 Subject: [PATCH] add some error checking with exit codes --- bin/vhost-disable.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/vhost-disable.sh b/bin/vhost-disable.sh index 2041419..e44a1df 100755 --- a/bin/vhost-disable.sh +++ b/bin/vhost-disable.sh @@ -25,9 +25,12 @@ vhost:getoptions "$@" # check for domain (virtualhost) if [[ -z $domain ]]; then echo "domain is required" - exit + exit 1 fi if [[ -h /etc/apache2/sites-enabled/$domain.conf ]]; then a2dissite --quiet $domain +else + echo "$domain is not enabled, nothing to do" + exit 1 fi