5 #. /opt/etc/conf.d/sshd
7 PIDFILE
=/var
/run
/obsshd.pid
8 PID
=$
(cat $PIDFILE 2>/dev
/null
)
9 if ! readlink
-q /proc
/$PID/exe |
grep -q '^/opt/ob-openssh/sbin/sshd'; then
11 rm $PIDFILE 2>/dev
/null
16 stat_busy
'Starting Secure Shell Daemon'
17 if [ ! -s "/opt/ob-openssh/etc/ssh_host_rsa_key" ]
19 /opt
/ob-openssh
/bin
/ssh-keygen
-t rsa
-f /opt
/ob-openssh
/etc
/ssh_host_rsa_key
-N ""
21 if [ ! -s "/opt/ob-openssh/etc/ssh_host_dsa_key" ]
23 /opt
/ob-openssh
/bin
/ssh-keygen
-t dsa
-f /opt
/ob-openssh
/etc
/ssh_host_dsa_key
-N ""
26 [[ -d /var
/empty
]] || mkdir
-p /var
/empty
27 [[ -z $PID ]] && /opt
/ob-openssh
/sbin
/sshd
$SSHD_ARGS
28 if [[ $?
-gt 0 ]]; then
36 stat_busy
'Stopping Secure Shell Daemon'
37 [[ ! -z $PID ]] && kill $PID &> /dev
/null
38 if [[ $?
-gt 0 ]]; then
51 echo "usage: $0 {start|stop|restart}"