fix CONFIG_FILENAME in uci_commit()
[openwrt-10.03/.git] / package / base-files / files / lib / config / uci.sh
index 957c1bb7cacefb3e859e82fd6991b6d721da3608..12795d813ff1b608128f6d749d193e2eacc6e2d7 100755 (executable)
@@ -23,7 +23,7 @@ uci_load() {
        config_load "$PACKAGE"
        local PACKAGE_BASE="$(basename "$PACKAGE")"
        [ -f "/tmp/.uci/${PACKAGE_BASE}" ] && {
-               . "/tmp/.uci/${PACKAGE_BASE}"
+               . "/tmp/.uci/${PACKAGE_BASE}" 2>/dev/null >/dev/null
                config_cb
        }
 }
@@ -127,7 +127,8 @@ uci_commit() {
                        return 0
                }
                
-               config_load "$PACKAGE" || CONFIG_FILENAME="$ROOT/etc/config/$PACKAGE_BASE"
+               config_load "$PACKAGE"
+               CONFIG_FILENAME="${CONFIG_FILENAME:-$ROOT/etc/config/$PACKAGE_BASE}"
                uci_do_update "$CONFIG_FILENAME" "$updatestr" > "/tmp/.uci/$PACKAGE_BASE.new" && {
                        mv -f "/tmp/.uci/$PACKAGE_BASE.new" "$CONFIG_FILENAME" && \
                        rm -f "/tmp/.uci/$PACKAGE_BASE"