dropbear: add mdns support to the init.d script
authorJohn Crispin <john@openwrt.org>
Fri, 29 Aug 2014 18:16:41 +0000 (18:16 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 29 Aug 2014 18:16:41 +0000 (18:16 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 42326

package/network/services/dropbear/files/dropbear.init

index c6f3d9ba82d51cbdc7790cb984d2e7aca1588038..5186523910d3a36abc950644c87cf05d2bcda6ab 100755 (executable)
@@ -46,14 +46,16 @@ validate_section_dropbear()
                'BannerFile:file' \
                'Port:list(port):22' \
                'SSHKeepAlive:uinteger:300' \
-               'IdleTimeout:uinteger:0'
+               'IdleTimeout:uinteger:0' \
+               'mdns:uinteger:1'
 }
 
 dropbear_instance()
 {
        local PasswordAuth enable Interface GatewayPorts \
                RootPasswordAuth RootLogin rsakeyfile \
-               dsskeyfile BannerFile Port SSHKeepAlive IdleTimeout
+               dsskeyfile BannerFile Port SSHKeepAlive IdleTimeout \
+               mdns
 
        validate_section_dropbear "${1}" || {
                echo "validation failed"
@@ -77,6 +79,7 @@ dropbear_instance()
        append_ports "${Interface}" "${Port}"
        [ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
        [ "${SSHKeepAlive}" -ne 0 ] && procd_append_param command -K "${SSHKeepAlive}"
+       [ "${mdns}" -ne 0 ] && procd_add_mdns "ssh" "tcp" "$Port" "daemon=dropbear"
        procd_close_instance
 }