aboutsummaryrefslogtreecommitdiffstats
path: root/include/shell.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-13 20:51:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-13 20:51:49 +0000
commit5b2f37e0cd7ef98a06611fb42b947d8984f0e12a (patch)
treed993cf48b4d89166701fe2f33976389d7634235d /include/shell.sh
parent79c3b44dbfbd6fb819a0daf64c2b797c29b04d85 (diff)
parent4b8e77121f1bcca81025c3fcb7b87bf869bef7f9 (diff)
downloadupstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.tar.gz
upstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.tar.bz2
upstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.zip
finally move buildroot-ng to trunk
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5059 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include/shell.sh')
-rw-r--r--include/shell.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/shell.sh b/include/shell.sh
new file mode 100644
index 0000000000..6ee0cf6030
--- /dev/null
+++ b/include/shell.sh
@@ -0,0 +1,15 @@
+getvar() {
+ eval "echo \"\${$1}\""
+}
+
+var2file() {
+ local var
+ eval "var=\"\${$1}\""
+ if [ -n "$var" ]; then echo "$var" > "$2"; fi
+}
+
+isset() {
+ local var
+ eval "var=\"\${$1}\""
+ [ -n "$var" ]
+}