Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问openwrt怎么开机自动启动trojan-go #491

Open
chainofhonor opened this issue Feb 24, 2023 · 1 comment
Open

请问openwrt怎么开机自动启动trojan-go #491

chainofhonor opened this issue Feb 24, 2023 · 1 comment

Comments

@chainofhonor
Copy link

/root/trojan/trojan-go -config /root/trojan/config-forward.json &
/root/trojan/trojan-go -config /root/trojan/config-nat.json &

就这2条命令,我放在/etc/rc.local里面的

这2条命令手动执行没问题,但是每次我重启openwrt,其他命令都生效,就这2条命令不生效,不管我把这2条命令放在什么位置,都不生效

导致每次停电或者路由器重启我都要手动执行一下

请问怎么弄才能实现开机自动启动?

@chainofhonor
Copy link
Author

chainofhonor commented Feb 25, 2023

if [ ! -f "/tmp/trojan-go.txt" ]
then
/etc/trojan-go/trojan-go -config /etc/trojan-go/config-forward.json &
/etc/trojan-go/trojan-go -config /etc/trojan-go/config-nat.json &
shijian=date
echo $shijian >> /tmp/trojan-go.txt
fi

我解决了 用crontab1分钟运行一次就好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant