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"
22 /usr/sbin/ipset -R < $IPSET_CONFIG && ok || fail
23 touch /var/lock/subsys/ipset
28 show "Resetting ipset rules"
29 /usr/sbin/ipset -X && ok || fail
30 rm -f /var/lock/subsys/ipset
47 /usr/sbin/ipset -L --sorted --numeric
51 show "Saving current rules to %s" $IPSET_CONFIG
53 chmod 600 $IPSET_CONFIG
54 /usr/sbin/ipset -S > $IPSET_CONFIG && ok || fail
58 msg_usage "$0 {start|stop|restart|force-reload|status|save}"