themes: Add registration of themes at package installation time
authorSteven Barth <steven@midlink.org>
Wed, 23 Jul 2008 11:32:53 +0000 (11:32 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 23 Jul 2008 11:32:53 +0000 (11:32 +0000)
libs/web/root/etc/config/luci
themes/openwrt.org/ipkg/postinst [new file with mode: 0755]
themes/openwrt.org/root/etc/uci-defaults/luci-theme-openwrt [new file with mode: 0755]

index 43c484a..b02fb51 100644 (file)
@@ -44,4 +44,3 @@ config internal template
        option compiledir "/tmp/.lucitplcache"
                
 config internal themes
-       option OpenWRT "/luci-static/openwrt.org"
diff --git a/themes/openwrt.org/ipkg/postinst b/themes/openwrt.org/ipkg/postinst
new file mode 100755 (executable)
index 0000000..48ea522
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ -n "${IPKG_INSTROOT}" ] || {
+       ( . /etc/uci-defaults/luci-theme-openwrt ) &&   rm -f /etc/uci-defaults/luci-theme-openwrt
+}
diff --git a/themes/openwrt.org/root/etc/uci-defaults/luci-theme-openwrt b/themes/openwrt.org/root/etc/uci-defaults/luci-theme-openwrt
new file mode 100755 (executable)
index 0000000..a8bef6c
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+uci batch <<-EOF
+       set luci.themes.OpenWRT=/luci-static/openwrt.org
+        commit luci
+EOF
+