diff options
Diffstat (limited to 'community/ipset/ipset.systemd')
-rw-r--r-- | community/ipset/ipset.systemd | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/community/ipset/ipset.systemd b/community/ipset/ipset.systemd index 36df5124a..92397f3a7 100644 --- a/community/ipset/ipset.systemd +++ b/community/ipset/ipset.systemd @@ -2,7 +2,21 @@ . /etc/conf.d/ipset -[[ -f $IPSET_CONF ]] || exit 1 -ipset restore < "$IPSET_CONF" +case $1 in + start) + ipset restore < "$CONFIG_FILE" + ;; + stop) + [[ $SAVE_ON_STOP =~ [yY][eE][sS] ]] && $0 save + ipset destroy + ;; + save) + ipset save > "$CONFIG_FILE" + ;; + *) + echo "usage: ${0##*/} {start|stop|save}" >&2 + exit 1 + ;; +esac # vim:set ts=2 sw=2 ft=sh et: |