Skip to content

Instantly share code, notes, and snippets.

@mxl
Created January 31, 2020 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxl/afc43f09496cfcf98e8a933be1433cce to your computer and use it in GitHub Desktop.
Save mxl/afc43f09496cfcf98e8a933be1433cce to your computer and use it in GitHub Desktop.
#!/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