Created
March 28, 2022 12:14
-
-
Save ZaphodB/64c14a344e98445e68a75469a57a9118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
S=`/usr/bin/pdns_control --socket-dir=/run/pdns show security-status` | |
if [ "$S" == "0" ] | |
then | |
echo "NXDOMAIN or resolution failure for security-status" | |
exit 3 | |
elif [ "$S" == "1" ] | |
then | |
echo "OK security-status received" | |
exit 0 | |
elif [ "$S" == "2" ] | |
then | |
echo "Upgrade recommended for security reasons, see PowerDNS Website for more information" | |
exit 1 | |
elif [ "$S" == "3" ] | |
then | |
echo "Upgrade mandatory for security reasons, see PowerDNS Website for more information" | |
exit 2 | |
else | |
echo "unknown response from pdns_control show security-status" | |
exit 3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment