]> git.pld-linux.org Git - packages/gated.git/commitdiff
- cleaning
authorankry <ankry@pld-linux.org>
Sun, 4 May 2003 20:17:17 +0000 (20:17 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gated.init -> 1.2

gated.init

index e006cf68e91213cd52080f6d3d062e12df81c58b..1368c58a6dc133e95577e892a62b1b2a7698ba97 100644 (file)
 . /etc/sysconfig/network
 
 # Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down gated
+               exit 1
+       fi
+else
+       exit 0
+fi
 
 gdc=/usr/bin/gdc
 
@@ -32,18 +39,28 @@ PATH=$PATH:/usr/bin:/usr/sbin
 # See how we were called.
 case "$1" in
   start)
-        echo -n "Starting gated: "
-        daemon gated
-        touch /var/lock/subsys/gated
-       echo
-        ;;
+       if [ ! -f /var/lock/subsys/gated ]; then
+               msg_starting gated
+               daemon gated
+               touch /var/lock/subsys/gated
+       else
+               msg_already_running gated
+               exit 1
+       fi
+       ;;
   stop)
-        # Stop daemons.
-        echo -n "Shutting down gated: "
-        $gdc stop
-        echo "gated done"
-        rm -f /var/lock/subsys/gated
-        ;;
+       if [ -f /var/lock/subsys/gated ]; then
+               # Stop daemons.
+               msg_stopping gated
+               busy
+               $gdc stop
+               ok
+               rm -f /var/lock/subsys/gated
+       else
+               msg_not_running gopherd
+               exit 1
+       fi
+       ;;
   status)
        $gdc running
        ;;
@@ -54,8 +71,8 @@ case "$1" in
        $gdc restart
        ;;
   *)
-        echo "Usage: $0 {start|stop|status|reload|restart}"
-        exit 1
+       msg_usage "$0 {start|stop|restart|reload|status}"
+       exit 1
 esac
 
 exit 0
This page took 0.076442 seconds and 4 git commands to generate.