]> git.pld-linux.org Git - packages/frox.git/blobdiff - frox.init
- formatting
[packages/frox.git] / frox.init
index ad67998e03e389ac11fdf49f0d2658a5d5f182dc..102f0f7206f4c7eeb4e3d276b0646396d0e5815a 100644 (file)
--- a/frox.init
+++ b/frox.init
@@ -11,6 +11,7 @@
 # Configuration file.
 . /etc/sysconfig/frox
 
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -18,31 +19,30 @@ case "$1" in
        if [ ! -f /var/lock/subsys/frox ]; then
                if [ ! "$IPCHAINS_RULE" ] && [ ! "$IPTABLES_RULE" ]; then
                        echo $(nls "Please edit /etc/sysconfig/frox")' !'
-                       exit 1
+                       exit 6
                fi
                msg_starting frox
                daemon frox -f /etc/frox.conf
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/frox
-               if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ] ; then
+               if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ]; then
                        run_cmd "Redirecting FTP traffic" '/usr/sbin/iptables -t nat -A $IPTABLES_RULE'
                fi
-               if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ] ; then
+               if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ]; then
                        run_cmd "Redirecting FTP traffic" '/sbin/ipchains -A $IPCHAINS_RULE'
                fi
 
        else
                msg_already_running frox
-               exit 1
        fi
        ;;
   stop)
        # Stop daemons.
        if [ -f /var/lock/subsys/frox ]; then
-               if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ] ; then
+               if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ]; then
                        run_cmd "Removing FTP traffic redirection" '/usr/sbin/iptables -D $IPTABLES_RULE'
                fi
-               if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ] ; then
+               if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ]; then
                        run_cmd "Removing FTP traffic redirection" '/sbin/ipchains -D $IPCHAINS_RULE'
                fi
                msg_stopping frox
@@ -50,20 +50,20 @@ case "$1" in
                rm -f /var/lock/subsys/frox /var/run/frox.pid >/dev/null 2>&1
        else
                msg_not_running frox
-               exit 1
        fi
        ;;
   status)
        status frox
        exit $?
        ;;
-  restart|reload)
+  restart|force-reload)
        $0 stop
        $0 start
+       exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
        ;;
 esac
 
This page took 0.067496 seconds and 4 git commands to generate.