summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/etc
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
commit5e01d653fab3ba1bbb5859e58615923645c9925d (patch)
treea8fe5772177a5d3f5b66d020185f877d4c3f78e5 /openwrt/package/base-files/default/etc
parent1e5f02e9d06a817352c4ce20338274b03f281b82 (diff)
downloadmtk-20170518-5e01d653fab3ba1bbb5859e58615923645c9925d.zip
mtk-20170518-5e01d653fab3ba1bbb5859e58615923645c9925d.tar.gz
mtk-20170518-5e01d653fab3ba1bbb5859e58615923645c9925d.tar.bz2
add a list append function to functions.sh
SVN-Revision: 4014
Diffstat (limited to 'openwrt/package/base-files/default/etc')
-rwxr-xr-xopenwrt/package/base-files/default/etc/functions.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh
index d54a346..fbb5a16 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
}