mirror of
https://github.com/9001/copyparty.git
synced 2026-04-12 15:22:32 -06:00
diff-golf :)
Signed-off-by: ed <s@ocv.me>
This commit is contained in:
parent
84b05940cf
commit
3f4dabe45c
|
|
@ -516,13 +516,13 @@ class TcpSrv(object):
|
||||||
if not ln.startswith("default"):
|
if not ln.startswith("default"):
|
||||||
continue
|
continue
|
||||||
yield ln.split()[7] if OPENBSD else ln.split()[3]
|
yield ln.split()[7] if OPENBSD else ln.split()[3]
|
||||||
else:
|
return
|
||||||
with open("/proc/net/route", "rb") as f:
|
with open("/proc/net/route", "rb") as f:
|
||||||
next(f)
|
next(f)
|
||||||
for ln in f:
|
for ln in f:
|
||||||
r = ln.decode("utf-8").strip().split()
|
r = ln.decode("utf-8").strip().split()
|
||||||
if r[1] == "0" * 8 and int(r[3], 16) & 2:
|
if r[1] == "0" * 8 and int(r[3], 16) & 2:
|
||||||
yield r[0]
|
yield r[0]
|
||||||
|
|
||||||
def _defroute(self) -> str:
|
def _defroute(self) -> str:
|
||||||
ret = ""
|
ret = ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue