2
1
Эх сурвалжийг харах

package/openssh: implement "reload" using SIGHUP

This is the documented "reload configuration" method for OpenSSH.

Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Fiona Klute (WIWA) 1 жил өмнө
parent
commit
2c14a55c6c
1 өөрчлөгдсөн 18 нэмэгдсэн , 2 устгасан
  1. 18 2
      package/openssh/S50sshd

+ 18 - 2
package/openssh/S50sshd

@@ -49,6 +49,19 @@ restart() {
 	start
 }
 
+reload() {
+	printf "Reloading sshd config: "
+	start-stop-daemon -K --signal HUP -q -p "$PIDFILE" \
+		-x "/usr/sbin/$DAEMON"
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
 case "$1" in
 	start)
 		start
@@ -56,11 +69,14 @@ case "$1" in
 	stop)
 		stop
 		;;
-	restart|reload)
+	restart)
 		restart
 		;;
+	reload)
+		reload
+		;;
 	*)
-		echo "Usage: $0 {start|stop|restart}"
+		echo "Usage: $0 {start|stop|restart|reload}"
 		exit 1
 esac