summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions.sh
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-12-01 16:15:13 +0000
committerJohn Crispin <john@openwrt.org>2014-12-01 16:15:13 +0000
commitb0d2a9e77aa35b92bb03cf1bd9036a3c13ee5130 (patch)
tree3f0a6f49d0ae48b039946316c88288ecc9551603 /package/base-files/files/lib/functions.sh
parentecd27db7573fd76347ef62c6d3bacba600e1c0cc (diff)
downloadmaster-31e0f0ae-b0d2a9e77aa35b92bb03cf1bd9036a3c13ee5130.tar.gz
master-31e0f0ae-b0d2a9e77aa35b92bb03cf1bd9036a3c13ee5130.tar.bz2
master-31e0f0ae-b0d2a9e77aa35b92bb03cf1bd9036a3c13ee5130.zip
base-files: default_postinst() - create user:group first (resend)
create user:group before running postinst-pkg. the postinst hook might require the user:group to already exist. Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com> SVN-Revision: 43472
Diffstat (limited to 'package/base-files/files/lib/functions.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index d53be3edfe..9d98fb0fbe 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -173,7 +173,6 @@ default_prerm() {
default_postinst() {
local name rusers
name=$(echo $(basename $1) | cut -d. -f1)
- [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg )
rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.control)
[ -n "$rusers" ] && {
local user group uid gid
@@ -212,6 +211,10 @@ default_postinst() {
done
done
}
+
+ [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg )
+ [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null
+
[ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
[ -n "${IPKG_INSTROOT}" ] && $(which bash) ${IPKG_INSTROOT}/etc/rc.common ${IPKG_INSTROOT}$i enable; \
[ -n "${IPKG_INSTROOT}" ] || {
@@ -219,7 +222,6 @@ default_postinst() {
$i start
}
done
- [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null
return 0
}