__ipset: ignore ipset errors when non-existing item is removed, or item is added twice.
We might choose to include human readable hostnames, rather than ip addresses. In these cases, we are unable to correctly detect membership, but ipset will resolve and error on duplicate. the sets contain ip addresses and not resolvable names, gencode-remote will produce output, but ipset will eventually resolve to ip addresses/check for real membership. For example: __ipset good-sites --type hash:ip --add cdi.st or: __ipset blocked-sites --type hash:ip --del cdi.st
This commit is contained in:
parent
c43bd0eed5
commit
e5099d32f3
1 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ if [ "$state_should" = "present" ]; then
|
||||||
if [ -f "$p/add" ]; then
|
if [ -f "$p/add" ]; then
|
||||||
while read -r value; do
|
while read -r value; do
|
||||||
if ! grep -q "$value" "$e/content"; then
|
if ! grep -q "$value" "$e/content"; then
|
||||||
echo "ipset add $name $value"
|
echo "ipset -! add $name $value"
|
||||||
needToSave=1
|
needToSave=1
|
||||||
fi
|
fi
|
||||||
done < "$p/add"
|
done < "$p/add"
|
||||||
|
@ -64,7 +64,7 @@ if [ "$state_should" = "present" ]; then
|
||||||
if [ -f "$p/del" ]; then
|
if [ -f "$p/del" ]; then
|
||||||
while read -r value; do
|
while read -r value; do
|
||||||
if grep -q "$value" "$e/content"; then
|
if grep -q "$value" "$e/content"; then
|
||||||
echo "ipset del $name $value"
|
echo "ipset -! del $name $value"
|
||||||
needToSave=1
|
needToSave=1
|
||||||
fi
|
fi
|
||||||
done < "$p/del"
|
done < "$p/del"
|
||||||
|
|
Loading…
Reference in a new issue