#!/bin/sh # # Start/Stop the OpenSSH secure shell daemon. # # Sean Boran for solaris 2.7: # cp startup-script /etc/init.d/opensshd # ln -s /etc/init.d/opensshd /etc/rc2.d/S10opensshd # ln -s /etc/init.d/opensshd /etc/rc2.d/K10opensshd PATH=/bin:/usr/bin:/opt/openssh/bin SSHD=/opt/openssh/sbin/sshd PID=/var/sshd.pid case $1 in 'start') start=false if [ ! -s $PID ] then start=true else kill -0 `cat $PID` >/dev/null 2>&1 || start=true fi if [ $start = true -a -x $SSHD ] then $SSHD echo 'OpenSSH Secure shell daemon started.' else echo 'OpenSSH Secure shell daemon not started.' fi ;; 'stop') if [ -s $PID ] then if kill `cat $PID` >/dev/null 2>&1 then echo 'OpenSSH Secure shell daemon terminated.' fi fi ;; *) echo 'Usage: /etc/init.d/opensshd start|stop' ;; esac