From: Jo-Philipp Wich Date: Mon, 3 Jun 2019 14:49:10 +0000 (+0200) Subject: themes: don't reset theme on package upgrades X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e9de0d25feb8e462441054e81ffe8b18b401760;p=oweals%2Fluci.git themes: don't reset theme on package upgrades Fixes: #2743 Signed-off-by: Jo-Philipp Wich (backported from commit 5fd071aadbcaa3b136a37fa2cbcb9799b0153e2a) --- diff --git a/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap b/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap index 09299e092..b5161843f 100755 --- a/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap +++ b/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap @@ -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 diff --git a/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic b/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic index 017e7f7ba..2cc083564 100644 --- a/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic +++ b/themes/luci-theme-freifunk-generic/root/etc/uci-defaults/30_luci-theme-freifunk-generic @@ -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 diff --git a/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material b/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material index b01337821..96ab46185 100755 --- a/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material +++ b/themes/luci-theme-material/root/etc/uci-defaults/30_luci-theme-material @@ -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 diff --git a/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt b/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt index aa0ba0c23..77e2f6064 100755 --- a/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt +++ b/themes/luci-theme-openwrt/root/etc/uci-defaults/30_luci-theme-openwrt @@ -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