1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/openssh/sshd.init
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
4 # Copyright (C) 1998 - 2003 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 # Desc: secure shell daemon
19 block_begin(start, `Starting sshd')
20 if ! test -e /etc/ssh/ssh_host_key -o \
21 -e /etc/ssh/ssh_host_dsa_key -o \
22 -e /etc/ssh/ssh_host_rsa_key -o \
23 -e /etc/ssh/ssh_host_ecdsa_key -o \
24 -e /etc/ssh/ssh_host_ed25519_key
26 echo "Can't start sshd: No ssh host keys found !!"\
27 "Please create the keys using either ssh-keygen or stone."
30 check(`D_prefix/sbin/sshd')
34 block_begin(stop, `Stopping sshd')
35 check(`if [ -s /var/run/sshd.pid ] ; then
36 kill $(cat /var/run/sshd.pid)
38 echo "sshd is not running or /var/run/sshd.pid disappeared."
43 block_begin(restart, `Restarting sshd')
44 check(`if [ -s /var/run/sshd.pid ] ; then
45 kill -HUP $(cat /var/run/sshd.pid)
47 echo "sshd is not running or /var/run/sshd.pid disappeared."