1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-03-09 15:40:05 +00:00

Add a timeout on ss -M command

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-06-29 06:56:20 +02:00
parent bb58cbcfa5
commit 1e36d2aa4b
2 changed files with 7 additions and 1 deletions

View file

@ -1336,7 +1336,7 @@ async def mptcpsupport(request: Request):
with open('/proc/net/mptcp_net/mptcp') as f:
if iptohex in f.read():
return {"mptcp": "working"}
elif not os.popen("ss -M | grep " + ip) == '':
elif not os.popen("timeout 2 ss -M | grep " + ip) == '':
return {"mptcp": "working"}
return {"mptcp": "not working"}