|
Lines 38-56
Link Here
|
| 38 |
elif configRegistry['interfaces/eth%s/address' % i]: |
38 |
elif configRegistry['interfaces/eth%s/address' % i]: |
| 39 |
print 'auto eth%s' % i |
39 |
print 'auto eth%s' % i |
| 40 |
print 'iface eth%s inet static' % i |
40 |
print 'iface eth%s inet static' % i |
| 41 |
print 'address '+configRegistry['interfaces/eth%s/address' % i] |
41 |
print ' address '+configRegistry['interfaces/eth%s/address' % i] |
| 42 |
if configRegistry['interfaces/eth%s/network' % i]: |
42 |
if configRegistry['interfaces/eth%s/network' % i]: |
| 43 |
print 'network '+configRegistry['interfaces/eth%s/network' % i] |
43 |
print ' network '+configRegistry['interfaces/eth%s/network' % i] |
| 44 |
if configRegistry['interfaces/eth%s/netmask' % i]: |
44 |
if configRegistry['interfaces/eth%s/netmask' % i]: |
| 45 |
print 'netmask '+configRegistry['interfaces/eth%s/netmask' % i] |
45 |
print ' netmask '+configRegistry['interfaces/eth%s/netmask' % i] |
| 46 |
if configRegistry['interfaces/eth%s/broadcast' % i]: |
46 |
if configRegistry['interfaces/eth%s/broadcast' % i]: |
| 47 |
print 'broadcast '+configRegistry['interfaces/eth%s/broadcast' % i] |
47 |
print ' broadcast '+configRegistry['interfaces/eth%s/broadcast' % i] |
| 48 |
if configRegistry['interfaces/eth%s/address' % i] and configRegistry['interfaces/eth%s/netmask' % i] and configRegistry['gateway'] and not gateway: |
48 |
if configRegistry['interfaces/eth%s/address' % i] and configRegistry['interfaces/eth%s/netmask' % i] and configRegistry['gateway'] and not gateway: |
| 49 |
if check_gateway(configRegistry['interfaces/eth%s/address' % i].split('.'), configRegistry['interfaces/eth%s/netmask' % i].split('.'), configRegistry['gateway'].split('.')): |
49 |
if check_gateway(configRegistry['interfaces/eth%s/address' % i].split('.'), configRegistry['interfaces/eth%s/netmask' % i].split('.'), configRegistry['gateway'].split('.')): |
| 50 |
print 'gateway '+configRegistry['gateway'] |
50 |
print 'gateway '+configRegistry['gateway'] |
| 51 |
gateway=True |
51 |
gateway=True |
| 52 |
configExists=True |
52 |
configExists=True |
| 53 |
|
53 |
|
|
|
54 |
if configRegistry['interfaces/eth%s/ipv6/address' % i]: #IPv6 |
| 55 |
print 'iface eth%s inet6 static' % i |
| 56 |
print ' address '+configRegistry['interfaces/eth%s/ipv6/address' % i] |
| 57 |
if configRegistry['interfaces/eth%s/ipv6/netmask' % i]: |
| 58 |
print ' netmask '+configRegistry['interfaces/eth%s/ipv6/netmask' % i] |
| 59 |
if configRegistry['interfaces/eth%s/ipv6/address' % i] and configRegistry['ipv6/gateway']: |
| 60 |
print ' gateway '+configRegistry['ipv6/gateway'] |
| 61 |
|
| 54 |
for j in range(0,4): |
62 |
for j in range(0,4): |
| 55 |
if configRegistry.has_key('interfaces/eth%s_%s/type' % (i,j)) and configRegistry['interfaces/eth%s_%s/type' % (i,j) ] == 'dhcp': |
63 |
if configRegistry.has_key('interfaces/eth%s_%s/type' % (i,j)) and configRegistry['interfaces/eth%s_%s/type' % (i,j) ] == 'dhcp': |
| 56 |
if configRegistry.get('interfaces/eth%s_%s/networkmanager' % ( i, j ), 'yes' ).lower() in ( 'no', 'false', '0' ): |
64 |
if configRegistry.get('interfaces/eth%s_%s/networkmanager' % ( i, j ), 'yes' ).lower() in ( 'no', 'false', '0' ): |