Skip to content

Instantly share code, notes, and snippets.

@xofer
Last active August 3, 2016 20:08
Show Gist options
  • Save xofer/3ae1cee78e2adaae35da2f553b9e7f74 to your computer and use it in GitHub Desktop.
Save xofer/3ae1cee78e2adaae35da2f553b9e7f74 to your computer and use it in GitHub Desktop.
safely reset ufw
#!/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