# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/openssh/sshd.init # Copyright (C) 2004 - 2023 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # # Desc: secure shell daemon # Runlevel: 25 rcX rc3 rc5 # main_begin block_begin(start, `Starting sshd') if ! test -e /etc/ssh/ssh_host_key -o \ -e /etc/ssh/ssh_host_rsa_key -o \ -e /etc/ssh/ssh_host_ecdsa_key -o \ -e /etc/ssh/ssh_host_ed25519_key then echo "No ssh host key found: see ssh-keygen(1) or stone!" IN error=1 else check(`D_sbindir/sshd') fi block_end block_begin(stop, `Stopping sshd') check(`if [ -s /var/run/sshd.pid ]; then kill $(cat /var/run/sshd.pid) else echo "sshd is not running or /var/run/sshd.pid disappeared." error=1 fi') block_end block_begin(restart, `Restarting sshd') check(`if [ -s /var/run/sshd.pid ]; then kill -HUP $(cat /var/run/sshd.pid) else echo "sshd is not running or /var/run/sshd.pid disappeared." error=1 fi') block_end main_end