diff options
Diffstat (limited to 'community/ipset/ipset.rc')
-rw-r--r-- | community/ipset/ipset.rc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/community/ipset/ipset.rc b/community/ipset/ipset.rc new file mode 100644 index 000000000..1d5f7df8b --- /dev/null +++ b/community/ipset/ipset.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/ipset + +case "$1" in + start) + stat_busy 'Loading IP Sets' + if [[ -f $IPSET_CONF ]] && ipset restore < "$IPSET_CONF"; then + add_daemon ipset + stat_done + else + stat_fail + fi + ;; + stop) + status 'Clearing IP Sets' ipset destroy + rm_daemon ipset + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + save) + stat_busy 'Saving IP Sets' + if ipset save > "$IPSET_CONF" 2>/dev/null; then + stat_done + else + stat_fail + fi + ;; + *) + echo "usage: ${0##*/} {start|stop|restart|save}" +esac +exit 0 + +# vim:set ts=2 sw=2 ft=sh et: |