db991004114fa5fbcb7f2ac10de7b172a1f0ea09
[openwrt/svn-archive/archive.git] / net / openssh / files / sshd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 START=50
4
5 start() {
6 for type in rsa dsa; do {
7 # check for keys
8 key=/etc/ssh/ssh_host_${type}_key
9 [ ! -f $key ] && {
10 # generate missing keys
11 [ -x /usr/bin/ssh-keygen ] && {
12 /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec /etc/rc.common "$initscript" start
13 } &
14 exit 0
15 }
16 }; done
17 mkdir -p /var/empty
18 /usr/sbin/sshd
19 }
20
21 stop() {
22 killall sshd
23 }