#!/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: