| # Donated code that was put under PD license. |
| # Stripped PRNGd out of it for the time being. |
| SSH_KEYGEN=$prefix/bin/ssh-keygen |
| HOST_KEY_RSA1=$sysconfdir/ssh_host_key |
| HOST_KEY_DSA=$sysconfdir/ssh_host_dsa_key |
| HOST_KEY_RSA=$sysconfdir/ssh_host_rsa_key |
| if [ ! -f $HOST_KEY_RSA1 ]; then |
| ${SSH_KEYGEN} -t rsa1 -f ${HOST_KEY_RSA1} -N "" |
| if [ ! -f $HOST_KEY_DSA ]; then |
| ${SSH_KEYGEN} -t dsa -f ${HOST_KEY_DSA} -N "" |
| if [ ! -f $HOST_KEY_RSA ]; then |
| ${SSH_KEYGEN} -t rsa -f ${HOST_KEY_RSA} -N "" |
| if [ -r $PIDFILE -a ! -z ${PIDFILE} ]; then |
| if [ ${PID:=0} -gt 1 -a ! "X$PID" = "X " ]; then |
| echo "Unable to read PID file" |
| # XXX We really should check if the service is already going, but |
| # XXX we will opt out at this time. - Bal |
| # Check to see if we have keys that need to be made |
| echo "starting $SSHD... \c" ; $SSHD |
| if [ $sshd_rc -ne 0 ]; then |
| echo "$0: Error ${sshd_rc} starting ${SSHD}... bailing." |
| echo "$0: usage: $0 {start|stop|restart}" |