Author: qboosh                       Date: Tue Oct 14 21:08:09 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added try-restart

---- Files affected:
SOURCES:
   smb.init (1.21 -> 1.22) 

---- Diffs:

================================================================
Index: SOURCES/smb.init
diff -u SOURCES/smb.init:1.21 SOURCES/smb.init:1.22
--- SOURCES/smb.init:1.21       Tue Oct 14 22:33:04 2008
+++ SOURCES/smb.init    Tue Oct 14 23:08:04 2008
@@ -66,27 +66,32 @@
        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 @@
                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
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/smb.init?r1=1.21&r2=1.22&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to