Created
January 31, 2020 14:36
-
-
Save mxl/afc43f09496cfcf98e8a933be1433cce to your computer and use it in GitHub Desktop.
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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment