mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 08:44:29 +00:00
fix: sudo does not exist
This commit is contained in:
parent
5bd322f960
commit
e73cba9713
@ -220,7 +220,7 @@ func CopyPileline(dst io.Writer, src io.Reader) {
|
||||
buf[start+i] = payloadByte[i]
|
||||
}
|
||||
} else {
|
||||
logrus.Debug(fmt.Sprintf("[%s] Not found User-Agent", string(parser.Host())))
|
||||
logrus.Debug(fmt.Sprintf("[%s] Not found User-Agent, Add LRU Relay Cache", string(parser.Host())))
|
||||
dst.Write(buf[0:nr])
|
||||
io.Copy(dst, src)
|
||||
cache.Add(string(dst.(*net.TCPConn).RemoteAddr().String()), string(dst.(*net.TCPConn).RemoteAddr().String()))
|
||||
|
||||
@ -21,7 +21,11 @@ ua3f_tar=ua3f-$version-$cpucore.tar.gz
|
||||
|
||||
if [ -f "ua3f" ]; then
|
||||
rm "ua3f"
|
||||
killall ua3f >/dev/null 2>&1
|
||||
killall ua3f &> /dev/null
|
||||
fi
|
||||
|
||||
if ! command -v sudo &> /dev/null then
|
||||
opkg update &> /dev/null && opkg install sudo &> /dev/null
|
||||
fi
|
||||
|
||||
chmod ugo+w /var/log
|
||||
|
||||
10
ua3f.service
10
ua3f.service
@ -4,12 +4,12 @@ START=99
|
||||
|
||||
start() {
|
||||
echo "ua3f is starting"
|
||||
if id -u shellclash >/dev/null 2>&1; then
|
||||
sudo -u shellclash /root/ua3f >/dev/null 2>&1 &
|
||||
elif id -u nobody >/dev/null 2>&1; then
|
||||
sudo -u nobody /root/ua3f >/dev/null 2>&1 &
|
||||
if id -u shellclash &> /dev/null; then
|
||||
sudo -u shellclash /root/ua3f &> /dev/null &
|
||||
elif id -u nobody &> /dev/null; then
|
||||
sudo -u nobody /root/ua3f &> /dev/null &
|
||||
else
|
||||
/root/ua3f >/dev/null 2>&1 &
|
||||
/root/ua3f &> /dev/null &
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user