projects
/
15.05
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add support for a common shell include file, which is evaluated for every make shell...
[15.05/openwrt.git]
/
include
/
shell.sh
diff --git a/include/shell.sh
b/include/shell.sh
new file mode 100644
(file)
index 0000000..
6ee0cf6
--- /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" ]
+}