1
0
mirror of https://github.com/gryf/wicd.git synced 2026-03-13 21:25:46 +01:00

Fix issues with the way disconnect scripts work.

Make flushing the route table more likely to work.
This commit is contained in:
Dan O'Reilly
2009-01-26 18:46:57 -05:00
parent ed9a0d63dc
commit d20dafa088
4 changed files with 25 additions and 15 deletions

View File

@@ -483,12 +483,15 @@ class BaseInterface(object):
def FlushRoutes(self):
""" Flush all network routes. """
if not self.iface: return False
if self.IP_FOUND and self.flush_tool != misc.ROUTE:
cmd = "ip route flush dev " + self.iface
if self.IP_FOUND and self.flush_tool == misc.IP:
#cmd = "ip route flush dev " + self.iface
cmds = ['ip route flush all']
else:
cmd = 'route del dev ' + self.iface
if self.verbose: print cmd
misc.Run(cmd)
cmds = ['route del default']
cmds.append('route del dev %s' % self.iface)
for cmd in cmds:
if self.verbose: print cmd
misc.Run(cmd)
def SetDefaultRoute(self, gw):
""" Add a default route with the specified gateway.