From af7a470f9c3f0c8546a90ae24a8494d3ee94efd6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 10 Oct 2006 15:30:50 +0000 Subject: add support for a common shell include file, which is evaluated for every make shell call, simplify variable passing to the shell with shvar and shexport templates, use Package//config for adding config.in data SVN-Revision: 5014 --- openwrt/include/shell.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 openwrt/include/shell.sh (limited to 'openwrt/include/shell.sh') diff --git a/openwrt/include/shell.sh b/openwrt/include/shell.sh new file mode 100644 index 0000000..6ee0cf6 --- /dev/null +++ b/openwrt/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" ] +} -- cgit v1.1