Created
June 10, 2015 19:02
-
-
Save anthonysr/ef2c619573b7c222d31e to your computer and use it in GitHub Desktop.
check_iptables_reload_chains
This file contains hidden or 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 | |
# | |
# Check if /etc/default/iptables exists *and* contains RELOAD_CHAINS=1 | |
# If yes, echo "RELOAD_CHAINS_BLOCKED" in any other case, echo "OK" | |
# | |
RELOAD_FILE=testreloadfile | |
RELOAD_CHAINS=1 | |
# Load defaults | |
if [ -f ${RELOAD_FILE} ]; then | |
. ${RELOAD_FILE} | |
fi | |
# See if we should run | |
if [ ${RELOAD_CHAINS} -ne 1 ]; then | |
echo "RELOAD_CHAINS!=1, check /etc/default/iptables, not reloading rules!" | |
exit 1 | |
else | |
echo "OK" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment