#!/sbin/sh case "$1" in 'start') if [ ! -d /usr/local/etc/ssh ]; then mkdir -p /usr/local/etc/ssh fi if [ ! -d /var/empty ]; then mkdir -p /var/empty fi # make host keys if [ ! -f /usr/local/etc/ssh/ssh_host_key ]; then /usr/local/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N "" fi if [ ! -f /usr/local/etc/ssh/ssh_host_dsa_key ]; then /usr/local/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N "" fi if [ ! -f /usr/local/etc/ssh/ssh_host_rsa_key ]; then /usr/local/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" fi if [ -f /usr/local/etc/ssh/sshd_config -a -x /usr/local/sbin/sshd ]; then /usr/local/sbin/sshd & echo "SSH server daemon started." fi ;; 'stop') /usr/bin/pkill -x -u 0 sshd ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0