#4985 - fixes dropbear banner file, thanks Roman Yepishev
authorJohn Crispin <john@openwrt.org>
Thu, 8 Oct 2009 18:58:15 +0000 (18:58 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 8 Oct 2009 18:58:15 +0000 (18:58 +0000)
SVN-Revision: 18009

package/dropbear/files/dropbear.config
package/dropbear/files/dropbear.init

index e660ac7356f11bf3c06f169d6eb4886a443b1976..492d2a1742a260af6ecc09f5dfd5e7ec0e4d1c72 100644 (file)
@@ -1,3 +1,4 @@
 config dropbear
        option PasswordAuth 'on'
        option Port         '22'
+#      option BannerFile   '/etc/banner'
index c91d0a71661d76a35e779e5ec93c8e6bc1cb1d5d..30cb44b1b151e309cdef616914625abe68c65bfb 100755 (executable)
@@ -34,10 +34,14 @@ 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=''
 
        # 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 }-P /var/run/${NAME}.${PIDCOUNT}.pid"
 
        # execute program and return its exit code
        [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} starting ${PROG} ${args}"