[baseimage]: bring down eth0 before restart networking (#1555)

cfggen generates new eth0 configuration. Need to first
clean existing configuration on eth0 before bring up
new configuration on eth0. Thus, we need to first bring
down eth0 before putting new configuration into /etc/network/
interfaces

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2018-04-01 21:36:43 -07:00 committed by GitHub
parent 8572f84ea0
commit 11b0cd93e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
#!/bin/bash
ifdown eth0
sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces
[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid