sshd revision 1.5
11.1Slukem#!/bin/sh 21.1Slukem# 31.5Sjwise# $NetBSD: sshd,v 1.5 2000/08/01 14:28:32 jwise Exp $ 41.5Sjwise# 51.1Slukem 61.3Sjwise# PROVIDE: ssh 71.3Sjwise# REQUIRE: NETWORK 81.1Slukem 91.1Slukem. /etc/rc.subr 101.1Slukem 111.1Slukemname="sshd" 121.3Sjwisecommand="/usr/sbin/sshd" 131.3Sjwiserequired_files="/etc/sshd.conf" 141.1Slukem 151.3Sjwiseextra_commands="keygen" 161.3Sjwise 171.3Sjwisesshd_keygen() { 181.3Sjwise if [ -f /etc/ssh_host_key ] 191.3Sjwise then 201.3Sjwise echo "You already have an RSA host key in /etc/ssh_host_key" 211.3Sjwise echo "Skipping RSA Key Generation" 221.3Sjwise else 231.3Sjwise umask 022 241.3Sjwise /usr/bin/ssh-keygen -b 1024 -f /etc/ssh_host_key -N '' 251.3Sjwise fi 261.3Sjwise 271.3Sjwise if [ -f /etc/ssh_host_dsa_key ] 281.3Sjwise then 291.3Sjwise echo "You already have a DSA host key in /etc/ssh_host_dsa_key" 301.4Sjlam echo "Skipping DSA Key Generation" 311.3Sjwise else 321.3Sjwise umask 022 331.3Sjwise /usr/bin/ssh-keygen -d -f /etc/ssh_host_dsa_key -N '' 341.3Sjwise fi 351.3Sjwise} 361.3Sjwise 371.5Sjwisesshd_precmd() { 381.3Sjwise if [ ! -f /etc/ssh_host_key -o ! -f /etc/ssh_host_dsa_key ] 391.3Sjwise then 401.3Sjwise /etc/rc.d/sshd keygen 411.3Sjwise fi 421.3Sjwise} 431.3Sjwise 441.3Sjwisekeygen_cmd=sshd_keygen 451.5Sjwisestart_precmd=sshd_precmd 461.3Sjwise 471.3Sjwiseload_rc_config $name 481.3Sjwiserun_rc_command "$1" 49