aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-06-19 21:45:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-06-19 21:45:07 +0000
commit5f5b339a140a01ad78645e7182ac959570f6a0d5 (patch)
tree468088e47ae105284a73af0e873adc644db535d6 /package/base-files
parent6634e3467c7c9d49a2fdd05d665ea2a05a427f98 (diff)
downloadupstream-5f5b339a140a01ad78645e7182ac959570f6a0d5.tar.gz
upstream-5f5b339a140a01ad78645e7182ac959570f6a0d5.tar.bz2
upstream-5f5b339a140a01ad78645e7182ac959570f6a0d5.zip
add a list append function to functions.sh
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4014 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/default/etc/functions.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh
index d54a346315..fbb5a160c4 100755
--- a/package/base-files/default/etc/functions.sh
+++ b/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
}