On 28-02-10 11:28, Stijn Tintel wrote:
> This patch allows multiple listen ports to be configured for dropbear in
> /etc/config/dropbear. It renames the 'Port' option to 'Ports', so this
> will break existing configs.
>
> Regards,
> Stijn
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>   
2nd attempt with attach :-)
Index: package/dropbear/files/dropbear.init
===================================================================
--- package/dropbear/files/dropbear.init        (revision 19881)
+++ package/dropbear/files/dropbear.init        (working copy)
@@ -32,9 +32,9 @@
        local passauth
        config_get_bool passauth "${section}" PasswordAuth 1
        [ "${passauth}" -eq 0 ] && nopasswd=1
-       # B) listen port
-       local port
-       config_get port "${section}" Port
+       # B) listen ports
+       local ports
+       config_get ports "${section}" Ports
        # C) banner file
        local bannerfile
        config_get bannerfile ${section} BannerFile
@@ -45,7 +45,10 @@
        [ "${gatewayports}" -eq 1 ] || gatewayports=''
        # concatenate parameters
        local args
-       args="${nopasswd:+-s }${port:+-p ${port} }${bannerfile:+-b $bannerfile 
}${gatewayports:+-a }-P /var/run/${NAME}.${PIDCOUNT}.pid"
+       args="${nopasswd:+-s }${bannerfile:+-b $bannerfile }${gatewayports:+-a 
}-P /var/run/${NAME}.${PIDCOUNT}.pid"
+       for port in $ports; do
+               append args "-p $port "
+       done
 
        # execute program and return its exit code
        [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} 
starting ${PROG} ${args}"
Index: package/dropbear/files/dropbear.config
===================================================================
--- package/dropbear/files/dropbear.config      (revision 19881)
+++ package/dropbear/files/dropbear.config      (working copy)
@@ -1,4 +1,4 @@
 config dropbear
        option PasswordAuth 'on'
-       option Port         '22'
+       option Ports         '22'
 #      option BannerFile   '/etc/banner'
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to