Created
December 4, 2015 03:08
-
-
Save t-cyrill/9c0544d509568270e8d6 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 | |
# more safety iptables-rule checker script | |
# Example | |
# iptables -A INPUT -p tcp --dport 22 -j REJECT | |
iptables-save > /tmp/iptables.up.rules.bak | |
( sleep 3; iptables-restore < /tmp/iptables.up.rules.bak; echo "Discard changes") & | |
iptables-restore < /etc/iptables.up.rules | |
echo "Press [y] key" | |
read line | |
case $line in | |
[yY]*) | |
kill $! | |
;; | |
*) | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment