stop nfsd and sshd on reboot (thx, puchu)
[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 STOP=50
5
6 start() {
7 for type in rsa dsa; do {
8 # check for keys
9 key=/etc/ssh/ssh_host_${type}_key
10 [ ! -f $key ] && {
11 # generate missing keys
12 [ -x /usr/bin/ssh-keygen ] && {
13 /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec /etc/rc.common "$initscript" start
14 } &
15 exit 0
16 }
17 }; done
18 mkdir -p /var/empty
19 chmod 0700 /var/empty
20 /usr/sbin/sshd
21 }
22
23 stop() {
24 killall sshd
25 }