]> git.pld-linux.org Git - packages/vtun.git/commitdiff
- rewrited with new functions
authorwaszi <waszi@pld-linux.org>
Thu, 16 Mar 2000 06:19:18 +0000 (06:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    vtun.init -> 1.2

vtun.init

index 3ab938ac3747119797af626397a315977a067dfc..22a9c54ac8e5e8baa499d29896e2189eb0d95fb4 100644 (file)
--- a/vtun.init
+++ b/vtun.init
 # Source function library.
 . /etc/rc.d/init.d/functions
 
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_no "${NETWORKING}"; then
+        msg_Network_Down Vtund
+        exit 1
+fi
+
 # See how we were called.
 case "$1" in
   start)
-        show Starting vtund
-        daemon /usr/sbin/vtund -s
-        touch /var/lock/subsys/vtund
+        # Check if the service is already running?
+        if [ ! -f /var/lock/subsys/vtund ]; then
+                msg_starting Vtund
+                daemon vtund -s
+                RETVAL=$?
+                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vtund
+        else
+                msg_Already_Running Vtund
+                exit 1
+        fi
+                                                                                                                                                               
         ;;
   stop)
-        show Stopping vtund
-        killproc vtund
-        rm -f /var/lock/subsys/vtund
+        # Stop daemons.
+       if [ -f /var/lock/subsys/vtund ]; then
+               msg_stopping Vtund
+               killproc vtund
+               rm -f /var/lock/subsys/vtund >/dev/null 2>&1
+       else
+                msg_Not_Running Vtund
+                exit 1
+        fi
         ;;
   restart)
        $0 stop
@@ -28,10 +51,11 @@ case "$1" in
         ;;
   status)
         status vtund
+       exit $?
         ;;
   *)
-        echo "Usage: vtund {start|stop|restart|status}"
+        msg_Usage "$0 {start|stop|restart|status}"
         exit 1
 esac
 
-exit 0
+exit $RETVAL
This page took 0.038803 seconds and 4 git commands to generate.