fix: fixed init and domain parser in script

This commit is contained in:
2026-04-05 14:24:00 +04:00
parent 9ea63e157f
commit 430d1c8276
3 changed files with 43 additions and 19 deletions
+27 -8
View File
@@ -1,26 +1,45 @@
#!/bin/sh /etc/rc.common
START=95
START=99
USE_PROCD=1
XRAY_BIN="/opt/.xray-manager/xray-manager.sh"
extra_command "update" "Download and refresh remote lists"
start_service() {
xray-manager start
procd_open_instance
procd_set_param command tail -f /dev/null
procd_set_param respawn
local timeout=20
while [ ! -s /proc/net/route ] && [ $timeout -gt 0 ]; do
sleep 1
timeout=$((timeout - 1))
done
timeout=20
while ! ping -q -c 1 -W 2 1.1.1.1 >/dev/null 2>&1 && [ $timeout -gt 0 ]; do
sleep 2
timeout=$((timeout - 2))
done
procd_open_instance "main"
procd_set_param command "$XRAY_BIN" start
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
procd_set_param limits core="unlimited"
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service() {
xray-manager stop
"$XRAY_BIN" stop
}
reload_service() {
xray-manager reload
"$XRAY_BIN" reload
}
update() {
xray-manager update
"$XRAY_BIN" update
}