themes: don't reset theme on package upgrades
authorJo-Philipp Wich <jo@mein.io>
Mon, 3 Jun 2019 14:49:10 +0000 (16:49 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Jun 2019 14:53:02 +0000 (16:53 +0200)
Fixes: #2743
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 5fd071aadbcaa3b136a37fa2cbcb9799b0153e2a)

themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap
themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic
themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material
themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt

index 09299e09221c8d9cdd753f08c435afdbe341718a..b5161843fea9b3eef064ce4f56a4f0612a8e7349 100755 (executable)
@@ -1,7 +1,11 @@
 #!/bin/sh
-uci batch <<-EOF
-       set luci.themes.Bootstrap=/luci-static/bootstrap
-       set luci.main.mediaurlbase=/luci-static/bootstrap
-       commit luci
-EOF
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+       uci batch <<-EOF
+               set luci.themes.Bootstrap=/luci-static/bootstrap
+               set luci.main.mediaurlbase=/luci-static/bootstrap
+               commit luci
+       EOF
+fi
+
 exit 0
index 017e7f7bad87543a374b336d50ee388e8a548416..2cc083564a4b2a6f4c0ec9057fe3d65d769cc51f 100644 (file)
@@ -1,5 +1,11 @@
-uci batch <<-EOF
-       set luci.themes.Freifunk_Generic=/luci-static/freifunk-generic
-       set luci.main.mediaurlbase=/luci-static/freifunk-generic
-        commit luci
-EOF
+#!/bin/sh
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+       uci batch <<-EOF
+               set luci.themes.Freifunk_Generic=/luci-static/freifunk-generic
+               set luci.main.mediaurlbase=/luci-static/freifunk-generic
+               commit luci
+       EOF
+fi
+
+exit 0
index b01337821c2eed38ffef8d5fc10e336d9bbd9083..96ab461859f1ec648cda161e56b605530f2b73cf 100755 (executable)
@@ -1,7 +1,11 @@
 #!/bin/sh
-uci batch <<-EOF
-       set luci.themes.Material=/luci-static/material
-       set luci.main.mediaurlbase=/luci-static/material
-       commit luci
-EOF
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+       uci batch <<-EOF
+               set luci.themes.Material=/luci-static/material
+               set luci.main.mediaurlbase=/luci-static/material
+               commit luci
+       EOF
+fi
+
 exit 0
index aa0ba0c231d884f4e1a65c0ad4ffc938b6777ac2..77e2f6064bf77cf1b5809e5a3c1c88ca1557b2c2 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/sh
-uci batch <<-EOF
-       set luci.themes.OpenWrt=/luci-static/openwrt.org
-       set luci.main.mediaurlbase=/luci-static/openwrt.org
-        commit luci
-EOF
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+       uci batch <<-EOF
+               set luci.themes.OpenWrt=/luci-static/openwrt.org
+               set luci.main.mediaurlbase=/luci-static/openwrt.org
+               commit luci
+       EOF
+fi
+
+exit 0