a5822e4f2bc886062d305efe5ac546009faba4c5
[openwrt/svn-archive/archive.git] / package / dropbear / files / dropbear.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 start() {
5 for type in rsa dss; do {
6 # check for keys
7 key=/etc/dropbear/dropbear_${type}_host_key
8 [ ! -f $key ] && {
9 # generate missing keys
10 mkdir -p /etc/dropbear
11 [ -x /usr/bin/dropbearkey ] && {
12 /usr/bin/dropbearkey -t $type -f $key 2>&- >&- && exec $0 $*
13 } &
14 exit 0
15 }
16 }; done
17
18 /usr/sbin/dropbear
19 }
20
21 stop() {
22 killall dropbear
23 }