7 PIDFILE
=/var
/run
/sshd.pid
8 PID
=$
(cat $PIDFILE 2>/dev
/null
)
9 if ! readlink
-q /proc
/$PID/exe |
grep -q '^/usr/sbin/sshd'; then
11 rm $PIDFILE 2>/dev
/null
16 stat_busy
"Starting Secure Shell Daemon"
17 [ -f /etc
/ssh
/ssh_host_key
] ||
{ /usr
/bin
/ssh-keygen
-t rsa1
-N "" -f /etc
/ssh
/ssh_host_key
>/dev
/null
; }
18 [ -f /etc
/ssh
/ssh_host_rsa_key
] ||
{ /usr
/bin
/ssh-keygen
-t rsa
-N "" -f /etc
/ssh
/ssh_host_rsa_key
>/dev
/null
; }
19 [ -f /etc
/ssh
/ssh_host_dsa_key
] ||
{ /usr
/bin
/ssh-keygen
-t dsa
-N "" -f /etc
/ssh
/ssh_host_dsa_key
>/dev
/null
; }
20 [ -f /etc
/ssh
/ssh_host_ecdsa_key
] ||
{ /usr
/bin
/ssh-keygen
-t ecdsa
-N "" -f /etc
/ssh
/ssh_host_ecdsa_key
>/dev
/null
; }
21 [ -d /var
/empty
] || mkdir
-p /var
/empty
22 [ -z "$PID" ] && /usr
/sbin
/sshd
$SSHD_ARGS
31 stat_busy
"Stopping Secure Shell Daemon"
32 [ ! -z "$PID" ] && kill $PID &> /dev
/null
46 echo "usage: $0 {start|stop|restart}"