9 test x
"${openssh:-NO}" = x
"NO" && exit 0
10 grep "^dropbear" /etc
/rc.conf
>/dev
/null
2>&1 || dropbear
=NO
11 if [[ $openssh = AUTO
&& $dropbear != NO
]]; then
12 echo openssh not starting
: set to AUTO and dropbear is enabled
15 test x
"$openssh" = x
"DAEMON" && test -x /bin
/mksh
&& exec mksh
-T- $0 start
19 if [[ ! -s /etc
/ssh
/ssh_host_rsa_key
]]; then
21 if [[ ! -x /usr
/bin
/ssh-keygen
]]; then
22 echo "openssh not starting: SSH private key missing"
25 echo "openssh: generating SSH private key (RSA)"
26 /usr
/bin
/ssh-keygen
-N '' -t rsa
-f /etc
/ssh
/ssh_host_rsa_key
28 echo openssh
: key generation exited with code
$rv
29 [[ $rv = 0 && -s /etc
/ssh
/ssh_host_rsa_key
]] ||
exit 1
31 mkdir
-p /var
/run
/sshd
33 touch /var
/log
/btmp
&& chmod 600 /var
/log
/btmp
37 if [ -e /var
/run
/sshd.pid
]; then
38 kill $
(cat /var
/run
/sshd.pid
)
46 echo "Usage: $0 {start | stop | restart}"