#!/bin/sh
#

CONFDIR=/etc
INIT=/etc/init.d/opensshd

[ -d $CONFDIR ] || mkdir -p $CONFDIR

[ -f /etc/ssh_host_key ] || {
    /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh_host_key -N ""
}
[ -f /etc/ssh_host_dsa_key ] || {
    /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -N ""
}
[ -f /etc/ssh_host_rsa_key ] || {
    /usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -N ""
}

# Enable the rc startup/shutdown scripts and start sshd
#
[ -x $INIT ] && {
    $INIT enable
    $INIT start
}

exit 0
