+ print 'UP: route add -net %(ip)s gw %(gateway)s netmask %(mascara)s dev %(iface)s metric %(metrica)s' % ruta
+ os.system('route add -net %(ip)s gw %(gateway)s netmask %(mascara)s dev %(iface)s metric %(metrica)s' % ruta)
+ os.system('cp /etc/hosts /etc/hosts.13.bak')
+ os.system('cp hosts /etc/hosts')
+ os.system('cp /etc/networks /etc/networks.13.bak')
+ os.system('cp networks /etc/networks')
+
+def down(host, fd):
+ hosts = parse(fd)
+ for iface in hosts[host]['ifaces']:
+ print 'DOWN: ifconfig %(iface)s down' % iface
+ if iface['iface'].startswith('ppp'):
+ os.system('killall pppd')
+ else:
+ os.system('ifconfig %(iface)s down' % iface)
+ os.system('mv /etc/hosts.13.bak /etc/hosts')
+ os.system('mv /etc/networks.13.bak /etc/networks')
+
+def list(fd):
+ hosts = parse(fd)
+ for host in hosts.keys():
+ print host