luci-mod-system: Fix broken JSON in ACL
[project/luci.git] / themes / luci-theme-bootstrap / root / etc / uci-defaults / 30_luci-theme-bootstrap
index b5161843fea9b3eef064ce4f56a4f0612a8e7349..f83d84702a1c21e883a1782ba4508d4261d14e18 100755 (executable)
@@ -1,11 +1,28 @@
 #!/bin/sh
 
-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
+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