diff --git a/bin/pdns-zone-ext.sh b/bin/pdns-zone-ext.sh index 93b26f1..955967d 100755 --- a/bin/pdns-zone-ext.sh +++ b/bin/pdns-zone-ext.sh @@ -19,7 +19,7 @@ help() echo " -h Print this help." echo " -z Zone to get." echo - echo " Echoes 'true' if zone exists, 'false' if zone does not exist, 'error' with exit code 1 on error." + echo " Echoes 'true' if zone exists with exit code 0, 'false' if zone does not exist with exit code 1, 'error' with exit code 2 on error." } pdns:getoptions "$@" @@ -36,11 +36,13 @@ zone_status=$(/usr/bin/curl --silent --output /dev/null --write-out "%{http_code if [[ $zone_status = 200 ]]; then # zone exists echo true + exit 0 elif [[ $zone_status = 404 ]]; then # zone does not exist echo false + exit 1 else # error, unexpected response code echo error - exit 1 + exit 2 fi