]> git.pld-linux.org Git - packages/openssh.git/commitdiff
- add try-restart
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 19 Feb 2011 16:06:03 +0000 (16:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    opensshd.init -> 1.46

opensshd.init

index edb892c0c2fe3aa108893a4f79b2885c386faa38..5a3a4cdcd32861ff2f0fa6bce213c47d29e3d2a8 100644 (file)
@@ -125,6 +125,18 @@ reload() {
        RETVAL=$?
 }
 
+condrestart() {
+       if [ ! -f /var/lock/subsys/sshd ]; then
+               msg_not_running "OpenSSH"
+               RETVAL=$1
+               return
+       fi
+
+       checkconfig
+       stop
+       start
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -139,6 +151,9 @@ case "$1" in
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
   reload|force-reload)
        reload
        ;;
@@ -156,7 +171,7 @@ case "$1" in
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|configtest|init|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|configtest|init|status}"
        exit 3
 esac
 
This page took 0.046594 seconds and 4 git commands to generate.