dropbear: fix dropbear startup issue
[openwrt/openwrt.git] / package / network / services / dropbear / files / dropbear.init
index b86e52d8bc26e27fbfaf215e82b10ec39511ab60..eef2643c14ac6b916bebb49e835186502afecce1 100755 (executable)
@@ -2,7 +2,7 @@
 # Copyright (C) 2006-2010 OpenWrt.org
 # Copyright (C) 2006 Carlos Sobrinho
 
-START=50
+START=19
 STOP=50
 
 USE_PROCD=1
@@ -59,6 +59,8 @@ dropbear_instance()
        }
 
        [ -n "${Interface}" ] && {
+               [ -n "${BOOT}" ] && return 0
+
                network_get_ipaddrs_all ipaddrs "${Interface}" || {
                        echo "interface ${Interface} has no physdev or physdev has no suitable ip"
                        return 1
@@ -119,6 +121,12 @@ load_interfaces()
        [ "${enable}" = "1" ] && interfaces=" ${interface} ${interfaces}"
 }
 
+boot()
+{
+       BOOT=1
+       start "$@"
+}
+
 start_service()
 {
        [ -s /etc/dropbear/dropbear_rsa_host_key ] || keygen