diff --git a/applications/sunpanel/Makefile b/applications/sunpanel/Makefile index 35ab5c9..34f23b7 100644 --- a/applications/sunpanel/Makefile +++ b/applications/sunpanel/Makefile @@ -40,6 +40,13 @@ define Package/$(PKG_NAME)/conffiles /etc/config/sunpanel endef +define Package/$(PKG_NAME)/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + [ -f /etc/uci-defaults/sunpanel ] && /etc/uci-defaults/sunpanel && rm -f /etc/uci-defaults/sunpanel +fi +endef + define Build/Configure endef @@ -47,12 +54,13 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/usr/libexec/istorec $(1)/usr/share/sunpanel + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/usr/libexec/istorec $(1)/usr/share/sunpanel $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/sunpanelbin.$(PKG_ARCH_sunpanel) $(1)/usr/sbin/sunpanelbin $(INSTALL_BIN) ./files/sunpanel.init $(1)/etc/init.d/sunpanel $(CP) ./files/sunpanel_conf.lua $(1)/usr/libexec/istorec/ $(CP) ./files/conf.temp $(1)/usr/share/sunpanel/ $(INSTALL_CONF) ./files/sunpanel.config $(1)/etc/config/sunpanel + $(INSTALL_BIN) ./files/sunpanel.uci-default $(1)/etc/uci-defaults/sunpanel endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/applications/sunpanel/files/sunpanel.uci-default b/applications/sunpanel/files/sunpanel.uci-default new file mode 100644 index 0000000..a6eef68 --- /dev/null +++ b/applications/sunpanel/files/sunpanel.uci-default @@ -0,0 +1,13 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@sunpanel[-1] + add ucitrack sunpanel + set ucitrack.@sunpanel[-1].init=sunpanel + commit ucitrack +EOF + +/etc/init.d/sunpanel enable + +exit 0 +