]> git.pld-linux.org Git - packages/samba.git/commitdiff
- added try-restart
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 14 Oct 2008 21:08:04 +0000 (21:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    smb.init -> 1.22

smb.init

index 00246a87ebce6746cf8382f4eb59789aecabe30c..5b906c0f93e970f095ecec37d23102bc147a292d 100644 (file)
--- a/smb.init
+++ b/smb.init
@@ -66,27 +66,32 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/smb ]; then
+               stop
+               start
+       else
+               msg_not_running smb
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
-       ;;
-  status)
-       status smbd
-       RETVAL=$?
-       status nmbd
-       RET=$?
-       [ $RETVAL -eq 0 ] && RETVAL=$RET
-       smbstatus
+       stop
        ;;
   restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
   reload|force-reload)
        if [ -f /var/lock/subsys/smb ]; then
                msg_reloading smb
@@ -97,8 +102,16 @@ case "$1" in
                exit 7
        fi
        ;;
+  status)
+       status smbd
+       RETVAL=$?
+       status nmbd
+       RET=$?
+       [ $RETVAL -eq 0 ] && RETVAL=$RET
+       smbstatus
+       ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
This page took 0.132017 seconds and 4 git commands to generate.