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>
This commit is contained in:
Fiona Klute (WIWA)
2024-07-04 12:16:31 +02:00
committed by Thomas Petazzoni
parent df605de134
commit 2c14a55c6c

View File

@@ -49,6 +49,19 @@ restart() {
start 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 case "$1" in
start) start)
start start
@@ -56,11 +69,14 @@ case "$1" in
stop) stop)
stop stop
;; ;;
restart|reload) restart)
restart restart
;; ;;
reload)
reload
;;
*) *)
echo "Usage: $0 {start|stop|restart}" echo "Usage: $0 {start|stop|restart|reload}"
exit 1 exit 1
esac esac