projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f80b9e4
)
scripts/utils.sh: add a function for setting a variable default
author
Felix Fietkau
<nbd@openwrt.org>
Tue, 29 Oct 2013 15:11:55 +0000
(16:11 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Tue, 29 Oct 2013 15:12:11 +0000
(16:12 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
scripts/utils.sh
patch
|
blob
|
history
diff --git
a/scripts/utils.sh
b/scripts/utils.sh
index 01d8ad5989f5092346823b4e277fab360b1c706d..a5dc782bfd4363340a5419341a7f27e2cbf7d3eb 100644
(file)
--- a/
scripts/utils.sh
+++ b/
scripts/utils.sh
@@
-13,6
+13,12
@@
add_default_handler() {
esac
}
+set_default() {
+ local __s_var="$1"
+ local __s_val="$2"
+ eval "export -- \"$__s_var=\${$__s_var:-\$__s_val}\""
+}
+
_config_add_generic() {
local type="$1"; shift