add error exit codes

This commit is contained in:
Matthew Saunders Brown 2022-05-10 09:53:40 -07:00
parent 18e103e50d
commit 5613604eb7

View File

@ -26,7 +26,7 @@ else
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable # check that MYSQL_CONNECTION_INFO_FILE exists and is readable
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then
echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable." echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable."
exit exit 1
fi fi
fi fi
fi fi
@ -99,7 +99,7 @@ function vmail:getoptions () {
alias=${alias%@*} alias=${alias%@*}
else else
echo "ERROR: $domain is not a valid domain name." echo "ERROR: $domain is not a valid domain name."
exit exit 1
fi fi
fi fi
;; ;;
@ -113,7 +113,7 @@ function vmail:getoptions () {
domain=${OPTARG,,} domain=${OPTARG,,}
if ! vmail::validate_domain $domain; then if ! vmail::validate_domain $domain; then
echo "ERROR: $domain is not a valid domain name." echo "ERROR: $domain is not a valid domain name."
exit exit 1
fi fi
;; ;;
e ) # email address e ) # email address