0003delete-with-comment_0 440 Bytes
Newer Older
1
2
3
4
#!/bin/bash

set -e

5
[[ $XT_MULTI == *xtables-nft-multi ]] || { echo "skip $XT_MULTI"; exit 0; }
6
7
8
9
10
11
12
13
14
15

comment1="foo bar"
comment2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

for ipt in iptables ip6tables; do
	for comment in "$comment1" "$comment2"; do
		$XT_MULTI $ipt -A INPUT -m comment --comment "$comment" -j ACCEPT
		$XT_MULTI $ipt -D INPUT -m comment --comment "$comment" -j ACCEPT
	done
done