1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 # Copyright (C) 2006 Carlos Sobrinho
6 local cfg
="$CONFIG_SECTION"
9 config_get cfgt
"$cfg" TYPE
13 config_get passauth
$cfg PasswordAuth
14 config_get port
$cfg Port
17 no|off|disabled|
0) nopasswd
=1;;
19 DROPBEAR_ARGS
="${nopasswd:+-s }${port:+-p $port}"
25 for keytype
in rsa dss
; do
27 key
=dropbear
/dropbear_
${keytype}_host_key
28 [ -f /tmp
/$key -o -f /etc
/$key ] ||
{
29 # generate missing keys
30 mkdir
-p /tmp
/dropbear
31 [ -x /usr
/bin
/dropbearkey
] && {
32 /usr
/bin
/dropbearkey
-t $keytype -f /tmp
/$key 2>&- >&- && exec /etc
/rc.common
"$initscript" start
38 lock
/tmp
/.switch2jffs
39 mkdir
-p /etc
/dropbear
40 mv /tmp
/dropbear
/dropbear_
* /etc
/dropbear
/
41 lock
-u /tmp
/.switch2jffs
42 chown root
/etc
/dropbear
43 chmod 0700 /etc
/dropbear
47 [ -f /etc
/dropbear
/dropbear_rsa_host_key
-a \
48 -f /etc
/dropbear
/dropbear_dss_host_key
] || keygen
51 /usr
/sbin
/dropbear
$DROPBEAR_ARGS
This page took 0.0556 seconds and 5 git commands to generate.