Luci terminal not working after modify /etc/init.d

I added the following script to /etc/init.d/. The script ran properly, but now the LuCI>Service>Terminal interface isn't working (192.168.0.2 refused to connect).

I think the last line might be blocking the process. If that's the case, how can I fix it?

#!/bin/sh /etc/rc.common

START=99

start() {
    sleep 3
    chmod +x /etc/sing-box/rule.nft
    /etc/sing-box/rule.nft
    ip rule add fwmark 1 table 100
    ip route add local 0.0.0.0/0 dev lo table 100
    sing-box run -c /etc/sing-box/config.json
}

sing-box is not made here, you need to ask where you acquired it from.

1 Like

What?

$ opkg list sing-box
sing-box - 1.9.3-1 - Sing-box is a universal proxy platform which supports hysteria, SOCKS, Shadowsocks,
 ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
1 Like

fixed by adding " &" at the last line.
sing-box run -c /etc/sing-box/config.json &

1 Like

its a proxy used in china to bypass internet censorship

1 Like

If it is wrong start script wortth posting issue with prroposed changes on github before it gets to stable release.

1 Like

@hlhp_beimei like @brada4 said, the sing-box comes with its own init script which should work, why are you not using it and creating your own?

Improvements to existing script always welcome :wink:

i think most people use the singbox core as a dependency, like luci-app-homeproxy which comes with a gui. the original init should work in that case.

actually, i put the script in the luci Local Startup, i don’t want to touch scripts that come by default.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.