forked from extern/shorewall_code
Restore SAVE_IPSET functionality
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
9493bda0cc
commit
4b74fe2823
@ -51,6 +51,10 @@ shorewall_start () {
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||
ipset -R < "$SAVE_IPSETS"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -68,6 +72,13 @@ shorewall_stop () {
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$SAVE_IPSETS" ]; then
|
||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user