mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +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]
|
buf[start+i] = payloadByte[i]
|
||||||
}
|
}
|
||||||
} else {
|
} 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])
|
dst.Write(buf[0:nr])
|
||||||
io.Copy(dst, src)
|
io.Copy(dst, src)
|
||||||
cache.Add(string(dst.(*net.TCPConn).RemoteAddr().String()), string(dst.(*net.TCPConn).RemoteAddr().String()))
|
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
|
if [ -f "ua3f" ]; then
|
||||||
rm "ua3f"
|
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
|
fi
|
||||||
|
|
||||||
chmod ugo+w /var/log
|
chmod ugo+w /var/log
|
||||||
|
|||||||
10
ua3f.service
10
ua3f.service
@ -4,12 +4,12 @@ START=99
|
|||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "ua3f is starting"
|
echo "ua3f is starting"
|
||||||
if id -u shellclash >/dev/null 2>&1; then
|
if id -u shellclash &> /dev/null; then
|
||||||
sudo -u shellclash /root/ua3f >/dev/null 2>&1 &
|
sudo -u shellclash /root/ua3f &> /dev/null &
|
||||||
elif id -u nobody >/dev/null 2>&1; then
|
elif id -u nobody &> /dev/null; then
|
||||||
sudo -u nobody /root/ua3f >/dev/null 2>&1 &
|
sudo -u nobody /root/ua3f &> /dev/null &
|
||||||
else
|
else
|
||||||
/root/ua3f >/dev/null 2>&1 &
|
/root/ua3f &> /dev/null &
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user