Skip to content

Instantly share code, notes, and snippets.

@ZaphodB
Created March 28, 2022 12:14
Show Gist options
  • Save ZaphodB/64c14a344e98445e68a75469a57a9118 to your computer and use it in GitHub Desktop.
Save ZaphodB/64c14a344e98445e68a75469a57a9118 to your computer and use it in GitHub Desktop.
#!/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