3 # /etc/rc.d/sshd: start/stop ssh daemon
6 SSD
=/sbin
/start-stop-daemon
9 KEYGEN
=/usr
/bin
/ssh-keygen
13 if [ ! -f $SSHDIR/ssh_host_rsa_key
]; then
14 $KEYGEN -q -t rsa
-b 2048 -N "" -f $SSHDIR/ssh_host_rsa_key
16 if [ ! -f $SSHDIR/ssh_host_dsa_key
]; then
17 $KEYGEN -q -t dsa
-N "" -f $SSHDIR/ssh_host_dsa_key
19 if [ ! -f $SSHDIR/ssh_host_ecdsa_key
]; then
20 $KEYGEN -q -t ecdsa
-b 521 -N "" -f $SSHDIR/ssh_host_ecdsa_key
22 if [ ! -f $SSHDIR/ssh_host_ed25519_key
]; then
23 $KEYGEN -q -t ed25519
-N "" -f $SSHDIR/ssh_host_ed25519_key
30 $SSD --start --pidfile $PID --exec $PROG
33 $SSD --stop --retry 10 --pidfile $PID
40 $SSD --status --pidfile $PID
42 0) echo "$PROG is running with pid $(cat $PID)" ;;
43 1) echo "$PROG is not running but the pid file $PID exists" ;;
44 3) echo "$PROG is not running" ;;
45 4) echo "Unable to determine the program status" ;;
49 echo "usage: $0 [start|stop|restart|status]"