mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 13:02:20 -07:00
fixed IPprefix variable for multi interfaces
This commit is contained in:
parent
c34ef1da3a
commit
c0fc747e95
1 changed files with 4 additions and 4 deletions
8
LANs.py
8
LANs.py
|
@ -914,14 +914,14 @@ def main():
|
||||||
ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN)
|
ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN)
|
||||||
ipr = ipr.communicate()[0]
|
ipr = ipr.communicate()[0]
|
||||||
iprs = ipr.split('\n')
|
iprs = ipr.split('\n')
|
||||||
for route in range(1,len(iprs)):
|
ipr = ipr.split()
|
||||||
iprs[route]=iprs[route].split()
|
|
||||||
ipr = repr(ipr).split(' ')
|
|
||||||
if args.routerip:
|
if args.routerip:
|
||||||
routerIP = args.routerip
|
routerIP = args.routerip
|
||||||
else:
|
else:
|
||||||
routerIP = ipr[2]
|
routerIP = ipr[2]
|
||||||
IPprefix = ipr[8][2:]
|
for r in iprs:
|
||||||
|
if '/' in r:
|
||||||
|
IPprefix = r.split()[0]
|
||||||
if args.interface:
|
if args.interface:
|
||||||
interface = args.interface
|
interface = args.interface
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue