]> git.pld-linux.org Git - packages/xtables-addons.git/commitdiff
- use $RETVAL for exit status. NOTE: stop should never fail auto/th/ipset-2_3_3a-1 auto/th/ipset-2_4_3-1 auto/th/ipset-2_4_3-2 auto/th/ipset-2_4_3-3 auto/th/ipset-2_4_3-4 auto/th/ipset-2_4_3-5 auto/th/ipset-2_4_3-6 auto/th/ipset-2_4_3-7 auto/th/ipset-2_4_3-8 auto/th/ipset-2_4_5-1 auto/th/ipset-2_4_5-2 auto/th/ipset-2_4_5-3 auto/th/ipset-2_4_5-4 auto/th/ipset-2_4_5-5 auto/th/ipset-2_4_5-6 auto/th/ipset-2_4_7-2 auto/th/ipset-2_4_7-3 auto/th/ipset-2_4_7-4 auto/th/ipset-2_4_9-1 auto/th/ipset-2_4_9-2 auto/th/ipset-2_5_0-1 auto/th/ipset-2_5_0-2 auto/th/ipset-2_5_0-4 auto/th/ipset-2_5_0-5 auto/th/ipset-2_5_0-6
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 11 Dec 2007 09:47:20 +0000 (09:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ipset.init -> 1.3

ipset.init

index d4a05fa95059f99d2c9ca745f7f8a8bca60c3bce..2fe2342b53542f5d50ade3873fe60ab803ee158c 100644 (file)
@@ -19,7 +19,13 @@ start() {
        if [ -f $IPSET_CONFIG ]; then
                show "Applying ipset rules"
                /usr/sbin/ipset -X
-               /usr/sbin/ipset -R < $IPSET_CONFIG && ok || fail
+               /usr/sbin/ipset -R < $IPSET_CONFIG
+               RETVAL=$?
+               if [ $RETVAL = 0 ]; then
+                       ok
+               else
+                       fail
+               fi
                touch /var/lock/subsys/ipset
        fi
 }
@@ -30,18 +36,16 @@ stop() {
        rm -f /var/lock/subsys/ipset
 }
 
+RETVAL=0
 case "$1" in
   start)
        start
-       exit $?
        ;;
   stop)
        stop
-       exit $?
        ;;
   restart|force-reload)
        start
-       exit $?
        ;;
   status)
        /usr/sbin/ipset -L --sorted --numeric
@@ -51,10 +55,17 @@ case "$1" in
        show "Saving current rules to %s" $IPSET_CONFIG
        touch $IPSET_CONFIG
        chmod 600 $IPSET_CONFIG
-       /usr/sbin/ipset -S > $IPSET_CONFIG && ok || fail
-       exit $?
+       /usr/sbin/ipset -S > $IPSET_CONFIG
+       RETVAL=$?
+       if [ $RETVAL = 0 ]; then
+               ok
+       else
+               fail
+       fi
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status|save}"
        exit 3
 esac
+
+exit $RETVAL
This page took 0.063091 seconds and 4 git commands to generate.