aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/lib/functions.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 323e057451..7da0c872fa 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -107,9 +107,14 @@ config_unset() {
# config_get <variable> <section> <option> [<default>]
# config_get <section> <option>
config_get() {
- case "$3" in
- "") eval echo "\"\${CONFIG_${1}_${2}:-\${4}}\"";;
- *) eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
+ case "$2${3:-$1}" in
+ *[^A-Za-z0-9_]*) : ;;
+ *)
+ case "$3" in
+ "") eval echo "\"\${CONFIG_${1}_${2}:-\${4}}\"";;
+ *) eval export ${NO_EXPORT:+-n} -- "${1}=\${CONFIG_${2}_${3}:-\${4}}";;
+ esac
+ ;;
esac
}