mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-06 04:52:18 -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 = ipr.communicate()[0]
|
||||
iprs = ipr.split('\n')
|
||||
for route in range(1,len(iprs)):
|
||||
iprs[route]=iprs[route].split()
|
||||
ipr = repr(ipr).split(' ')
|
||||
ipr = ipr.split()
|
||||
if args.routerip:
|
||||
routerIP = args.routerip
|
||||
else:
|
||||
routerIP = ipr[2]
|
||||
IPprefix = ipr[8][2:]
|
||||
for r in iprs:
|
||||
if '/' in r:
|
||||
IPprefix = r.split()[0]
|
||||
if args.interface:
|
||||
interface = args.interface
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue