mirror of
https://github.com/gryf/wicd.git
synced 2026-02-19 16:35:46 +01:00
All branches/trunk:
- Specify the device to use in SetDefaultRoute
This commit is contained in:
@@ -548,10 +548,11 @@ class Interface(object):
|
|||||||
gw -- gateway of the default route in dotted quad form
|
gw -- gateway of the default route in dotted quad form
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not self.iface: return
|
||||||
if not misc.IsValidIP(gw):
|
if not misc.IsValidIP(gw):
|
||||||
print 'WARNING: Invalid gateway found. Aborting!'
|
print 'WARNING: Invalid gateway found. Aborting!'
|
||||||
return False
|
return False
|
||||||
cmd = 'route add default gw ' + gw
|
cmd = 'route add default gw %s dev %s' % (gw, self.iface)
|
||||||
if self.verbose: print cmd
|
if self.verbose: print cmd
|
||||||
misc.Run(cmd)
|
misc.Run(cmd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user