From 2c14a55c6cf28ada9f1d3d17d3b11370829372ca Mon Sep 17 00:00:00 2001 From: "Fiona Klute (WIWA)" Date: Thu, 4 Jul 2024 12:16:31 +0200 Subject: [PATCH] package/openssh: implement "reload" using SIGHUP This is the documented "reload configuration" method for OpenSSH. Signed-off-by: Fiona Klute (WIWA) Signed-off-by: Thomas Petazzoni --- package/openssh/S50sshd | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/package/openssh/S50sshd b/package/openssh/S50sshd index 781aad8715..d16a7ad8fc 100644 --- a/package/openssh/S50sshd +++ b/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