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:49:10 +0000 (16:49 +0200)
Fixes: #2743
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap
themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material
themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt
themes/luci-theme-rosy/root/etc/uci-defaults/30_luci-theme-rosy

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 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
index 2657a2977958c192efa2ffc2ff772e6906c79f02..ab0299a9c3c8c2eff538e4aa41c86fa30dc02c99 100755 (executable)
@@ -1,7 +1,11 @@
 #!/bin/sh
-uci batch <<-EOF
-       set luci.themes.Rosy=/luci-static/rosy
-       set luci.main.mediaurlbase=/luci-static/rosy
-       commit luci
-EOF
+
+if [ "$PKG_UPGRADE" != 1 ]; then
+       uci batch <<-EOF
+               set luci.themes.Rosy=/luci-static/rosy
+               set luci.main.mediaurlbase=/luci-static/rosy
+               commit luci
+       EOF
+fi
+
 exit 0