dropbear: support comma-separated list of addresses in port spec
authorRoman I Khimov <khimov@altell.ru>
Thu, 3 Jun 2010 14:18:05 +0000 (18:18 +0400)
committerRoman I Khimov <khimov@altell.ru>
Wed, 9 Jun 2010 07:17:29 +0000 (11:17 +0400)
Signed-off-by: Roman I Khimov <khimov@altell.ru>
recipes/dropbear/dropbear.inc
recipes/dropbear/dropbear/init

index f0b621a..5da00f2 100644 (file)
@@ -6,7 +6,7 @@ DEPENDS = "zlib"
 PROVIDES = "ssh sshd"
 RPROVIDES = "ssh sshd"
 
-INC_PR = "r2"
+INC_PR = "r3"
 
 SRC_URI = "\
   http://matt.ucc.asn.au/dropbear/dropbear-${PV}.tar.bz2 \
index 5c8dfc1..275aa32 100755 (executable)
@@ -19,6 +19,9 @@ test "$NO_START" = "0" || exit 0
 test -x "$DAEMON" || exit 0
 test ! -h /var/service/dropbear || exit 0
 
+# Allows comma-separated list of addresses/ports
+DROPBEAR_PORT=`echo $DROPBEAR_PORT | sed "s/,/ -p /g"`
+
 readonly_rootfs=0
 for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
   case $flag in
@@ -74,7 +77,7 @@ case "$1" in
        test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
        start-stop-daemon -S \
          -x "$DAEMON" -- $KEY_ARGS \
-           -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+           -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS
        echo "$NAME."
        ;;
   stop)
@@ -91,7 +94,7 @@ case "$1" in
        test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
        start-stop-daemon -S \
          -x "$DAEMON" -- $KEY_ARGS \
-           -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+           -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS
        echo "$NAME."
        ;;
   *)