Commit 73c745f6 authored by Marko Ratkaj's avatar Marko Ratkaj Committed by Mathias Kresin
Browse files fix default_postinst function

When we run "opkg install" on a package that installs an uci-defaults
script, will fail to evaluate that script in its
default_postinst function.

This happens because there is no "./" present and it searches for the
file in paths specified by the PATH variable. This would work on bash,
but it will not work on ash and some other shells like sh, zsh. This
applys to the ". filename" directive used in this case.

This patch will make the path relative to the /etc/uci-defaults

Fixes: FS#1021
Signed-off-by: default avatarMarko Ratkaj <>
parent 74f89175
......@@ -244,7 +244,7 @@ default_postinst() {
[ -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"
[ -f "$i" ] && . ./"$i" && rm -f "$i"
) done
uci commit
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment