Created
January 31, 2020 14:36
-
-
Save mxl/afc43f09496cfcf98e8a933be1433cce to your computer and use it in GitHub Desktop.
Revisions
-
mxl created this gist
Jan 31, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/usr/bin/env bash set -e PATTERN=$1 COUNT=0 for RULE in $(sudo ufw status numbered | (grep $PATTERN | awk -F"[][]" '{print $2}')); do sudo ufw --force delete $((RULE-COUNT)) ((COUNT=COUNT+1)) done