Last active
August 3, 2016 20:08
-
-
Save xofer/3ae1cee78e2adaae35da2f553b9e7f74 to your computer and use it in GitHub Desktop.
safely reset ufw
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 | |
set -e | |
ufw disable | |
iptables -F | |
iptables -X | |
ip6tables -F | |
ip6tables -X | |
ufw --force enable | |
echo "Disabling firewall in 5s in case the circut's dead, something's wrong..." | |
echo "Press Ctrl-C if you can read this, Major Tom!" | |
sleep 5 | |
ufw disable | |
echo "Firewall disabled!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment