don't fail on uci_load() with nonexisting config files, but return the right return code
SVN-Revision: 10433
This commit is contained in:
parent
e1bb6ae6be
commit
c86404e5a1
1 changed files with 7 additions and 1 deletions
|
@ -19,15 +19,21 @@
|
|||
|
||||
uci_load() {
|
||||
local PACKAGE="$1"
|
||||
local DATA
|
||||
local RET
|
||||
|
||||
_C=0
|
||||
export ${NO_EXPORT:+-n} CONFIG_SECTIONS=
|
||||
export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=0
|
||||
export ${NO_EXPORT:+-n} CONFIG_SECTION=
|
||||
|
||||
eval "$(/sbin/uci ${LOAD_STATE:+-P /var/state} -S -n export "$PACKAGE")"
|
||||
DATA="$(/sbin/uci ${LOAD_STATE:+-P /var/state} -S -n export "$PACKAGE" 2>/dev/null)"
|
||||
RET="$?"
|
||||
[ "$RET" != 0 -o -z "$DATA" ] || eval "$DATA"
|
||||
unset DATA
|
||||
|
||||
${CONFIG_SECTION:+config_cb}
|
||||
return "$RET"
|
||||
}
|
||||
|
||||
uci_set_default() {
|
||||
|
|
Loading…
Reference in a new issue