mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 01:44:16 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_ARCH_FASTNET:=$(ARCH)
|
||||
|
||||
PKG_NAME:=fastnet
|
||||
PKG_VERSION:=0.7.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://dl.istoreos.com/binary/fastnet/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=FastNet - network test Web UI
|
||||
DEPENDS:=@(arm||x86_64||aarch64)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
FastNet provides network testing tools and a Web UI.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/fastnet
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -f /etc/uci-defaults/fastnet ] && /etc/uci-defaults/fastnet && rm -f /etc/uci-defaults/fastnet
|
||||
exit 0
|
||||
fi
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fastnet.$(PKG_ARCH_FASTNET) $(1)/usr/sbin/FastNet
|
||||
$(INSTALL_CONF) ./files/fastnet.config $(1)/etc/config/fastnet
|
||||
$(INSTALL_BIN) ./files/fastnet.init $(1)/etc/init.d/fastnet
|
||||
$(INSTALL_BIN) ./files/fastnet.uci-default $(1)/etc/uci-defaults/fastnet
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,5 @@
|
||||
config fastnet
|
||||
option enabled '1'
|
||||
option port '3200'
|
||||
option token ''
|
||||
option logger '0'
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled "$1" enabled 1
|
||||
config_get port "$1" port 3200
|
||||
config_get token "$1" token ""
|
||||
config_get_bool logger "$1" logger 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load fastnet
|
||||
config_foreach get_config fastnet
|
||||
[ "$enabled" != 1 ] && return 1
|
||||
|
||||
addr="0.0.0.0:${port}"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param limits nofile="65535 65535"
|
||||
procd_set_param command /usr/sbin/FastNet web --addr "$addr" --no-open
|
||||
[ -n "$token" ] && procd_append_param command --token "$token"
|
||||
[ "$logger" = 1 ] && procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "fastnet"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
[ ! -f "/usr/share/ucitrack/luci-app-fastnet.json" ] && {
|
||||
cat > /usr/share/ucitrack/luci-app-fastnet.json << EEOF
|
||||
{
|
||||
"config": "fastnet",
|
||||
"init": "fastnet"
|
||||
}
|
||||
EEOF
|
||||
}
|
||||
|
||||
uci -q batch <<-EOF_UCI >/dev/null
|
||||
delete ucitrack.@fastnet[-1]
|
||||
add ucitrack fastnet
|
||||
set ucitrack.@fastnet[-1].init=fastnet
|
||||
commit ucitrack
|
||||
|
||||
EOF_UCI
|
||||
|
||||
/etc/init.d/fastnet enable
|
||||
/etc/init.d/fastnet start
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user