packages: openssh/opensshd.init - add try-restart

glen glen at pld-linux.org
Sat Feb 19 17:06:08 CET 2011


Author: glen                         Date: Sat Feb 19 16:06:08 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add try-restart

---- Files affected:
packages/openssh:
   opensshd.init (1.45 -> 1.46) 

---- Diffs:

================================================================
Index: packages/openssh/opensshd.init
diff -u packages/openssh/opensshd.init:1.45 packages/openssh/opensshd.init:1.46
--- packages/openssh/opensshd.init:1.45	Sat Feb  5 10:53:07 2011
+++ packages/openssh/opensshd.init	Sat Feb 19 17:06:03 2011
@@ -125,6 +125,18 @@
 	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 @@
 	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
   reload|force-reload)
 	reload
 	;;
@@ -156,7 +171,7 @@
 	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
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/openssh/opensshd.init?r1=1.45&r2=1.46&f=u



More information about the pld-cvs-commit mailing list