Skip to content
Snippets Groups Projects
Commit 6d0ab843 authored by Edward Hicks's avatar Edward Hicks :8ball:
Browse files

only match beginning of the chain names in the regex

parent 3213c55d
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
#
for TABLE in nat mangle raw; do
iptables -v -t $TABLE -F
CHAINS=$(iptables -t $TABLE -L | egrep '^Chain' | awk '{print $2}' | egrep --color=never '(KUBE|DOCKER|cali)($|\-)')
CHAINS=$(iptables -t $TABLE -L | egrep '^Chain' | awk '{print $2}' | egrep --color=never '^(KUBE|DOCKER|cali)($|\-)')
for C in $CHAINS; do iptables -v -t $TABLE -X $C; done
done
......@@ -18,7 +18,7 @@ iptables -v -F FORWARD
# Then go through the others deleting them after removing anything
# that refers to them
DELETE_CHAINS=$(iptables -L | egrep '^Chain' | awk '{print $2}' | egrep --color=never '(KUBE|DOCKER|cali)($|\-)')
DELETE_CHAINS=$(iptables -L | egrep '^Chain' | awk '{print $2}' | egrep --color=never '^(KUBE|DOCKER|cali)($|\-)')
for DC in $DELETE_CHAINS; do
CHAINS=$(iptables -L | egrep '^Chain' | awk '{print $2}')
iptables -v -F $DC
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment