add istorerouter (#684)
Co-authored-by: jannson <jannon.wei@gmail.com>
diff --git a/applications/app-meta-istorerouter/Makefile b/applications/app-meta-istorerouter/Makefile
new file mode 100644
index 0000000..c432329
--- /dev/null
+++ b/applications/app-meta-istorerouter/Makefile
@@ -0,0 +1,38 @@
+# This is free software, licensed under the Apache License, Version 2.0 .
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=1
+META_TITLE:=iStoreRouter
+META_TITLE.en:=iStoreRouter
+META_DEPENDS:=+luci-app-istorerouter +luci-theme-istorenas
+META_DESCRIPTION:=为 iStoreOS 提供路由状态、网络配置、无线设置、DDNS、存储管理和应用商店入口。
+META_DESCRIPTION.en:=Router dashboard for iStoreOS with network, Wi-Fi, DDNS, storage, and app store entry points.
+META_AUTHOR:=Xiaobao
+META_ARCH:=x86_64 aarch64
+META_TAGS:=net system
+META_LUCI_ENTRY:=/cgi-bin/luci/admin/istorerouter
+META_WEBSITE:=https://github.com/linkease
+META_TUTORIAL:=https://doc.linkease.com/zh/guide/istoreos/
+
+define Package/app-meta-istorerouter/prerm
+#!/bin/sh
+
+LANDING_PAGE="/cgi-bin/luci/admin/istorerouter"
+
+if uci -q show istorenas.@login[0] >/dev/null; then
+ CURRENT_LANDING_PAGE="$$(uci -q get istorenas.@login[0].landing_page)"
+ if [ "$$CURRENT_LANDING_PAGE" = "$$LANDING_PAGE" ]; then
+ uci -q delete istorenas.@login[0].landing_page || true
+ uci -q commit istorenas || true
+ fi
+fi
+
+rm -f /tmp/luci-indexcache /tmp/luci-indexcache.*
+exit 0
+endef
+
+include ../../meta.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/app-meta-istorerouter/config.sh b/applications/app-meta-istorerouter/config.sh
new file mode 100755
index 0000000..1243db7
--- /dev/null
+++ b/applications/app-meta-istorerouter/config.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+[ -z "$ISTORE_CONF_DIR" ] && exit 1
+
+LANDING_PAGE="/cgi-bin/luci/admin/istorerouter"
+
+[ -e /etc/config/luci ] || touch /etc/config/luci || exit 1
+[ -e /etc/config/istorenas ] || touch /etc/config/istorenas || exit 1
+
+if ! uci -q show luci.main >/dev/null; then
+ uci -q set luci.main=core || exit 1
+fi
+
+if ! uci -q show luci.themes >/dev/null; then
+ uci -q set luci.themes=internal || exit 1
+fi
+
+if ! uci -q show istorenas.@login[0] >/dev/null; then
+ uci -q add istorenas login >/dev/null || exit 1
+fi
+
+uci -q batch <<-EOF >/dev/null || exit 1
+ set luci.themes.iStoreNAS="/luci-static/istorenas"
+ set luci.main.mediaurlbase="/luci-static/istorenas"
+ set istorenas.@login[0].landing_page="$LANDING_PAGE"
+ commit luci
+ commit istorenas
+EOF
+
+rm -f /tmp/luci-indexcache /tmp/luci-indexcache.*
diff --git a/applications/app-meta-istorerouter/logo.png b/applications/app-meta-istorerouter/logo.png
new file mode 100644
index 0000000..08cb646
Binary files /dev/null and b/applications/app-meta-istorerouter/logo.png differ
GitHub
sha: 38dd2b7f0281dd8916d22ec813c7755fdc6c4f38