mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 02:08:50 +01:00
change gateway ip address last digit calculation
This commit is contained in:
parent
e8dc44fb3e
commit
807fdfa428
@ -207,9 +207,13 @@ class GateWayPage(Page):
|
|||||||
if "error" not in out[1]:
|
if "error" not in out[1]:
|
||||||
parts = out[1].split(".")
|
parts = out[1].split(".")
|
||||||
if len(parts) == 4:##IPv4
|
if len(parts) == 4:##IPv4
|
||||||
tmp = int(parts[3]) + 1
|
tp3 = int(parts[3])
|
||||||
if tmp > 255:
|
tmp = tp3
|
||||||
tmp = 255
|
if tp3 == 0:
|
||||||
|
tmp = int(parts[3]) + 1
|
||||||
|
elif tp3 > 0:
|
||||||
|
tmp = int(parts[3]) - 1
|
||||||
|
|
||||||
parts[3] = str(tmp)
|
parts[3] = str(tmp)
|
||||||
ipaddress = ".".join(parts)
|
ipaddress = ".".join(parts)
|
||||||
os.system("sudo route add default gw "+ipaddress)
|
os.system("sudo route add default gw "+ipaddress)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user