dropbear: make missing variables local
[openwrt/staging/dedeckeh.git] / package / network / services / dropbear / files / dropbear.init
index 97017dd4a89502e8ab3bcc265063b9675d71423c..5206426ec30075e98c23ab7d159ecce9587b8b71 100755 (executable)
@@ -38,13 +38,15 @@ validate_section_dropbear()
                'PasswordAuth:bool:1' \
                'enable:bool:1' \
                'Interface:string' \
-               'GatewayPorts:integer:0' \
+               'GatewayPorts:bool:0' \
                'RootPasswordAuth:bool:1' \
                'RootLogin:bool:1' \
                'rsakeyfile:file' \
                'dsskeyfile:file' \
                'BannerFile:file' \
-               'Port:list(port):22'
+               'Port:list(port):22' \
+               'SSHKeepAlive:uinteger:300' \
+               'IdleTimeout:uinteger:0'
        return $?
 }
 
@@ -52,7 +54,7 @@ dropbear_instance()
 {
        local PasswordAuth enable Interface GatewayPorts \
                RootPasswordAuth RootLogin rsakeyfile \
-               dsskeyfile BannerFile Port
+               dsskeyfile BannerFile Port SSHKeepAlive IdleTimeout
 
        validate_section_dropbear "${1}" || {
                echo "validation failed"
@@ -72,8 +74,10 @@ dropbear_instance()
        [ -n "${rsakeyfile}" ] && procd_append_param command -r "${rsakeyfile}"
        [ -n "${dsskeyfile}" ] && procd_append_param command -d "${dsskeyfile}"
        [ -n "${BannerFile}" ] && procd_append_param command -b "${BannerFile}"
-       [ -n "${interface}" ] && network_get_device interface "${interface}"
-       append_ports "${interface}" "${Port}"
+       [ -n "${Interface}" ] && network_get_device Interface "${Interface}"
+       append_ports "${Interface}" "${Port}"
+       [ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
+       [ "${SSHKeepAlive}" -ne 0 ] && procd_append_param command -K "${SSHKeepAlive}"
        procd_close_instance
 }