Last active
July 22, 2016 15:21
-
-
Save snoopdouglas/acf62700071ed125ac7102c623170e13 to your computer and use it in GitHub Desktop.
One-liner to delete all ufw rules without disabling or reloading the firewall
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
for j in $(for i in $(sudo ufw status numbered | (grep -E '[0-9]+/(tc|ud)p' |awk -F"[][]" '{print $2}') ) ; do echo $i ; done | tac) ; do sudo ufw --force delete $j ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment