add some error checking with exit codes
This commit is contained in:
parent
8cb1be03cb
commit
b3cd92e8ff
|
@ -25,9 +25,12 @@ vhost:getoptions "$@"
|
||||||
# check for domain (virtualhost)
|
# check for domain (virtualhost)
|
||||||
if [[ -z $domain ]]; then
|
if [[ -z $domain ]]; then
|
||||||
echo "domain is required"
|
echo "domain is required"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -h /etc/apache2/sites-enabled/$domain.conf ]]; then
|
if [[ -h /etc/apache2/sites-enabled/$domain.conf ]]; then
|
||||||
a2dissite --quiet $domain
|
a2dissite --quiet $domain
|
||||||
|
else
|
||||||
|
echo "$domain is not enabled, nothing to do"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user