fixed an issue cuaisng router to die
- router should not die when an error happens when connecting to HW + install will restart changed network interfaces
This commit is contained in:
@@ -12,7 +12,7 @@ from ipaddress import IPv4Interface
|
||||
from configparser import ConfigParser
|
||||
from os.path import join, getmtime, exists
|
||||
|
||||
os.chdir('to_system')
|
||||
os.chdir('/root/aputools/to_system')
|
||||
|
||||
DEL = '__to_delete__'
|
||||
CFGPATH = '/root/aputools/servercfg/%s.cfg'
|
||||
@@ -173,6 +173,8 @@ def network(doit):
|
||||
if doit:
|
||||
with open('/etc/sysconfig/network-scripts/ifcfg-%s' % ifname, 'w') as f:
|
||||
f.write('%s\n' % '\n'.join('%s=%s' % kv for kv in content.items()))
|
||||
os.system('ifdown %s' % ifname)
|
||||
os.system('ifup %s' % ifname)
|
||||
else:
|
||||
dirty = 'dirty'
|
||||
print('%s changed:' % ifname)
|
||||
|
||||
Reference in New Issue
Block a user