2 # Donated code that was put under PD license.
4 # Stripped PRNGd out of it for the time being.
16 SSHD=$prefix/sbin/sshd
17 PIDFILE=$piddir/sshd.pid
18 SSH_KEYGEN=$prefix/bin/ssh-keygen
19 HOST_KEY_RSA1=$etcdir/ssh_host_key
20 HOST_KEY_DSA=$etcdir/ssh_host_dsa_key
21 HOST_KEY_RSA=$etcdir/ssh_host_rsa_key
26 ${PS} -u root | ${AWK} '/'"$_procname"'$/ {print $1}' | ${XARGS} ${KILL}
31 if [ ! -f $HOST_KEY_RSA1 ]; then
32 ${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N ""
34 if [ ! -f $HOST_KEY_DSA ]; then
35 ${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N ""
37 if [ ! -f $HOST_KEY_RSA ]; then
38 ${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N ""
43 if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then
44 PID=`${CAT} ${PIDFILE}`
46 if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then
49 echo "Unable to read PID file, killing using alternate method"
55 # XXX We really should check if the service is already going, but
56 # XXX we will opt out at this time. - Bal
58 # Check to see if we have keys that need to be made
62 echo "starting $SSHD... \c" ; $SSHD
65 if [ $sshd_rc -ne 0 ]; then
66 echo "$0: Error ${sshd_rc} starting ${SSHD}... bailing."
88 echo "$0: usage: $0 {start|stop|restart}"