summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-bootstrap/root/etc/uci-defaults
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-11-16 13:11:45 +0100
committerJo-Philipp Wich <jo@mein.io>2021-11-16 13:19:29 +0100
commit0bc09cc749439e233afdf9cd71c14f67090a3a07 (patch)
treedf6fa9da02d85be0bd82e1731fe563a47cb82fd2 /themes/luci-theme-bootstrap/root/etc/uci-defaults
parent8055acc9be89f0bed31b6692ad08e6196611d478 (diff)
luci-theme-bootstrap: don't overwrite theme selection upon install
Revert to the previous uci-defaults behaviour of only setting the selected theme to Bootstrap if the Bootstrap entry didn't exist yet in the configuration. Ref: https://forum.openwrt.org/t/luci-theme-behaviour-change/112047 Fixes: ed86f03a9f ("luci-theme-bootstrap: add explicit dark/light mode selection") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'themes/luci-theme-bootstrap/root/etc/uci-defaults')
-rwxr-xr-xthemes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap16
1 files changed, 8 insertions, 8 deletions
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 b66e5b2be3..f83d84702a 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
@@ -6,21 +6,21 @@ set_opt() {
local key=$1
local val=$2
- if ! uci -q get "luci.themes.$key" 2>/dev/null; then
- uci set "luci.themes.$key=$val"
+ if ! uci -q get "luci.$key" 2>/dev/null; then
+ uci set "luci.$key=$val"
changed=1
fi
}
-set_opt Bootstrap /luci-static/bootstrap
-set_opt BootstrapDark /luci-static/bootstrap-dark
-set_opt BootstrapLight /luci-static/bootstrap-light
+set_opt themes.Bootstrap /luci-static/bootstrap
-if [ "$PKG_UPGRADE" != 1 ]; then
- uci set luci.main.mediaurlbase=/luci-static/bootstrap
- changed=1
+if [ "$PKG_UPGRADE" != 1 ] && [ $changed = 1 ]; then
+ set_opt main.mediaurlbase /luci-static/bootstrap
fi
+set_opt themes.BootstrapDark /luci-static/bootstrap-dark
+set_opt themes.BootstrapLight /luci-static/bootstrap-light
+
if [ $changed = 1 ]; then
uci commit luci
fi