3x-ui 式共享节点改造:nodes 状态机 + nodeClients 各自凭据
- 移除 VMess 协议 - VLESS/SS2022 按用户流量统计(AnyTLS 日志解析,SS 节点级) - sing-box v2ray_api stats 支持 - 内存优化:面板 128M,agent 64M,sing-box 64M
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# NexusGate 控制面 procd 服务(OpenWrt)
|
||||
# 由 scripts/install.sh 安装到 /etc/init.d/nexusgate
|
||||
|
||||
USE_PROCD=1
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
ENV_FILE=/etc/nexusgate.env
|
||||
APP_DIR=/opt/nexusgate
|
||||
|
||||
start_service() {
|
||||
[ -f "$ENV_FILE" ] || return 1
|
||||
[ -x /usr/bin/node ] || return 1
|
||||
[ -f "$APP_DIR/server.js" ] || return 1
|
||||
procd_open_instance nexusgate
|
||||
procd_set_param command /usr/bin/node --max-old-space-size=128 --optimize-for-size "$APP_DIR/server.js"
|
||||
# 注意:procd 的 env 参数不支持多次调用累加(后一次覆盖前一次),必须把所有变量攒到一次调用里
|
||||
set --
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
case "$line" in
|
||||
''|\#*) continue ;;
|
||||
*=*) set -- "$@" "$line" ;;
|
||||
esac
|
||||
done < "$ENV_FILE"
|
||||
[ $# -gt 0 ] && procd_set_param env "$@"
|
||||
procd_set_param respawn 3600 5 5
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user