aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2016-11-21 15:16:07 +0100
committerJonas Gorski <jonas.gorski@gmail.com>2016-11-21 18:40:15 +0100
commitafaa34ccd7343e478df8c0cd49019363692bcd16 (patch)
treedddb0505208205cd8b39929c1778ba2f151ed452 /package/base-files/files
parenta58f176ef2367f000a60a5ce477beb3cbdedf82e (diff)
downloadupstream-afaa34ccd7343e478df8c0cd49019363692bcd16.tar.gz
upstream-afaa34ccd7343e478df8c0cd49019363692bcd16.tar.bz2
upstream-afaa34ccd7343e478df8c0cd49019363692bcd16.zip
base-files: don't modify enabled state of service on upgrade
Properly stop/start services on upgrade, but don't change the enabled state. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 232a1c4ed2..a5838f6035 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -175,7 +175,9 @@ default_prerm() {
if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
else
- "$i" disable
+ if [ "$PKG_UPGRADE" != "1" ]; then
+ "$i" disable
+ fi
"$i" stop
fi
done
@@ -240,17 +242,17 @@ default_postinst() {
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
- if [ "$PKG_UPGRADE" != "1" ]; then
- local shell="$(which bash)"
- for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
- if [ -n "$root" ]; then
- ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
- else
+ local shell="$(which bash)"
+ for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
+ if [ -n "$root" ]; then
+ ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
+ else
+ if [ "$PKG_UPGRADE" != "1" ]; then
"$i" enable
- "$i" start
fi
- done
- fi
+ "$i" start
+ fi
+ done
return $ret
}