diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-05-23 12:45:39 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-05-23 12:45:39 -0300 |
commit | 7516400a778a0a4a0668d0a2ea797a635d6d4dd2 (patch) | |
tree | 5ab321abf9f41be345f44409235b62ccb31e0d49 /community/ipset/ipset.rc | |
parent | 1de77ff2ad96a2adfd9eb797bb2ca1bb15c2a707 (diff) | |
parent | 39c366b9fc1b83a741177d0b415a20147a18a3c0 (diff) |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre-mips64el
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: |