aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpackage/base-files/files/lib/functions.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 318e91856b..23598f9c74 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -229,10 +229,9 @@ default_postinst() {
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
- for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
- cd /etc/uci-defaults
- [ -f "$i" ] && . ./"$i" && rm -f "$i"
- ) done
+ for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
+ ( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
+ done
uci commit
fi