stop dropbear at shutdown as well
[openwrt.git] / package / dropbear / files / dropbear.init
index c91d0a71661d76a35e779e5ec93c8e6bc1cb1d5d..4ee130c3a570cb5bbe05a33b1ff3db553191a1a6 100755 (executable)
@@ -5,6 +5,7 @@
 NAME=dropbear
 PROG=/usr/sbin/dropbear
 START=50
+STOP=50
 PIDCOUNT=0
 EXTRA_COMMANDS="killclients"
 EXTRA_HELP="   killclients Kill ${NAME} processes except servers and yourself"
@@ -34,10 +35,17 @@ dropbear_start()
        # B) listen port
        local port
        config_get port "${section}" Port
-
+       # C) banner file
+       local bannerfile
+       config_get bannerfile ${section} BannerFile
+       [ -f $bannerfile ] || bannerfile=''
+       # D) gatewayports
+       local gatewayports
+       config_get_bool gatewayports "${section}" GatewayPorts 0
+       [ "${gatewayports}" -eq 1 ] || gatewayports=''
        # concatenate parameters
        local args
-       args="${nopasswd:+-s }${port:+-p ${port}-P /var/run/${NAME}.${PIDCOUNT}.pid"
+       args="${nopasswd:+-s }${port:+-p ${port} }${bannerfile:+-b $bannerfile }${gatewayports:+-a }-P /var/run/${NAME}.${PIDCOUNT}.pid"
 
        # execute program and return its exit code
        [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} starting ${PROG} ${args}"