summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap
blob: b66e5b2be3934714dcffef6bd4f4b98a627513b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

changed=0

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"
		changed=1
	fi
}

set_opt Bootstrap /luci-static/bootstrap
set_opt BootstrapDark /luci-static/bootstrap-dark
set_opt BootstrapLight /luci-static/bootstrap-light

if [ "$PKG_UPGRADE" != 1 ]; then
	uci set luci.main.mediaurlbase=/luci-static/bootstrap
	changed=1
fi

if [ $changed = 1 ]; then
	uci commit luci
fi

exit 0