From 5e01d653fab3ba1bbb5859e58615923645c9925d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 19 Jun 2006 21:45:07 +0000 Subject: [PATCH] add a list append function to functions.sh SVN-Revision: 4014 --- openwrt/package/base-files/default/etc/functions.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index d54a346315..fbb5a160c4 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -1,6 +1,10 @@ #!/bin/sh alias debug=${DEBUG:-:} +# newline +N=" +" + # valid interface? if_valid () ( ifconfig "$1" >&- 2>&- || @@ -12,6 +16,13 @@ hotplug_dev() { env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug net } +append() { + local var="$1" + local value="$2" + local sep="${3:- }" + eval "export ${var}=\"\${${var}:+\${${var}}${value:+$sep}}$value\"" +} + config_cb() { return 0 } -- 2.30.2