fix: potential loop

This commit is contained in:
SunBK201 2023-12-05 23:01:58 +08:00
parent 78d41d6789
commit fb8d909f39
3 changed files with 28 additions and 10 deletions

View File

@ -22,7 +22,12 @@ export url='https://blog.sunbk201.site/cdn' && sh -c "$(curl -kfsSl $url/install
### 手动启动 ### 手动启动
```bash ```bash
/root/ua3f -p <port> -f <UA> -b <bind addr> sudo -u nobody /root/ua3f -p <port> -f <UA> -b <bind addr>
```
shellclash 用户建议使用以下命令启动:
```bash
sudo -u shellclash /root/ua3f -p <port> -f <UA> -b <bind addr>
``` ```
### 作为后台服务运行 ### 作为后台服务运行
@ -33,11 +38,22 @@ export url='https://blog.sunbk201.site/cdn' && sh -c "$(curl -kfsSl $url/install
执行下面的命令: 执行下面的命令:
```bash ```bash
chmod +x /etc/init.d/ua3f.service chmod +x /etc/init.d/ua3f.service
# 设置 UA3F 开机自启
service ua3f.service enable service ua3f.service enable
# 启动 UA3F
service ua3f.service start service ua3f.service start
``` ```
关闭或重启 UA3F 命令:
```bash
# 关闭 UA3F
service ua3f.service start
# 重启 UA3F
service ua3f.service restart
```
### Clash 的配置建议 ### Clash 的配置建议
请确保 `PROCESS-NAME,ua3f,DIRECT` 置于规则列表顶部。 请确保 `PROCESS-NAME,ua3f,DIRECT` 置于规则列表顶部。
可以在 `PROCESS-NAME,ua3f,DIRECT``MATCH,ua3f` 之间按需加入自定义加密代理规则。如果上述 2 条规则之间加入 DIRECT 规则,请确保匹配该规则的流量属于非 HTTP 协议流量 可以在 `PROCESS-NAME,ua3f,DIRECT``MATCH,ua3f` 之间按需加入自定义加密代理规则。如果上述 2 条规则之间加入 DIRECT 规则,请确保匹配该规则的流量属于非 HTTP 协议流量

0
install.sh Normal file → Executable file
View File

18
ua3f.service Normal file → Executable file
View File

@ -1,17 +1,19 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
START=99 START=99
start(){
start() {
echo "ua3f is starting" echo "ua3f is starting"
/root/ua3f > /var/log/ua3f.log 2>&1 & if id -u shellclash >/dev/null 2>&1; then
sudo -u shellclash /root/ua3f >/var/log/ua3f.log 2>&1 &
elif id -u nobody >/dev/null 2>&1; then
sudo -u nobody /root/ua3f >/var/log/ua3f.log 2>&1 &
else
/root/ua3f >/var/log/ua3f.log 2>&1 &
fi
} }
stop(){ stop() {
echo "ua3f is stopping" echo "ua3f is stopping"
killall ua3f killall ua3f
} }
restart(){
killall ua3f
/root/ua3f &
}