3 # chkconfig: 2345 07 93
4 # description: Automates administration of IP sets.
5 # config: /etc/sysconfig/ipset
7 IPSET_CONFIG=/etc/sysconfig/ipset
8 if [ ! -f $IPSET_CONFIG ]; then
10 start|restart|force-reload)
16 . /etc/rc.d/init.d/functions
19 if [ -f $IPSET_CONFIG ]; then
20 show "Applying ipset rules"
21 /usr/sbin/ipset -R $IPSET_CONFIG && ok || fail
22 touch /var/lock/subsys/ipset
27 show "Resetting ipset rules"
28 /usr/sbin/ipset -X && ok || fail
29 rm -f /var/lock/subsys/ipset
43 /usr/sbin/ipset -L --sorted --numeric
46 show "Saving current rules to %s" $IPSET_CONFIG
48 chmod 600 $IPSET_CONFIG
49 /usr/sbin/ipset -S > $IPSET_CONFIG 2>/dev/null && ok || fail
52 msg_usage "$0 {start|stop|restart|force-reload|status|save}"