mirror of
https://github.com/openwrt/luci.git
synced 2025-02-06 18:09:56 +00:00
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>
29 lines
483 B
Bash
Executable File
29 lines
483 B
Bash
Executable File
#!/bin/sh
|
|
|
|
changed=0
|
|
|
|
set_opt() {
|
|
local key=$1
|
|
local val=$2
|
|
|
|
if ! uci -q get "luci.$key" 2>/dev/null; then
|
|
uci set "luci.$key=$val"
|
|
changed=1
|
|
fi
|
|
}
|
|
|
|
set_opt themes.Bootstrap /luci-static/bootstrap
|
|
|
|
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
|
|
|
|
exit 0
|