START/STOP values must be specified in the init script
[packages.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 }