SOURCES: ipset.init - fix typos, exit codes, restart flow.

pluto pluto at pld-linux.org
Tue Dec 11 07:49:30 CET 2007


Author: pluto                        Date: Tue Dec 11 06:49:30 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix typos, exit codes, restart flow.

---- Files affected:
SOURCES:
   ipset.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/ipset.init
diff -u SOURCES/ipset.init:1.1 SOURCES/ipset.init:1.2
--- SOURCES/ipset.init:1.1	Mon Dec 10 21:10:46 2007
+++ SOURCES/ipset.init	Tue Dec 11 07:49:25 2007
@@ -18,7 +18,8 @@
 start() {
 	if [ -f $IPSET_CONFIG ]; then
 		show "Applying ipset rules"
-		/usr/sbin/ipset -R $IPSET_CONFIG && ok || fail
+		/usr/sbin/ipset -X
+		/usr/sbin/ipset -R < $IPSET_CONFIG && ok || fail
 		touch /var/lock/subsys/ipset
 	fi
 }
@@ -32,25 +33,28 @@
 case "$1" in
   start)
 	start
+	exit $?
 	;;
   stop)
 	stop
+	exit $?
 	;;
   restart|force-reload)
 	start
+	exit $?
 	;;
   status)
 	/usr/sbin/ipset -L --sorted --numeric
+	exit $?
 	;;
   save)
 	show "Saving current rules to %s" $IPSET_CONFIG
 	touch $IPSET_CONFIG
 	chmod 600 $IPSET_CONFIG
-	/usr/sbin/ipset -S > $IPSET_CONFIG  2>/dev/null && ok || fail
+	/usr/sbin/ipset -S > $IPSET_CONFIG && ok || fail
+	exit $?
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|force-reload|status|save}"
 	exit 3
 esac
-
-exit 0
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/ipset.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list