Skip to content

Commit

Permalink
Revert "[baseos] Avoid disconnecting mgmt when re-cfg interfaces (#553)"
Browse files Browse the repository at this point in the history
This reverts commit e74196c.
  • Loading branch information
lguohan authored Jun 7, 2017
1 parent e3bad3d commit eb99886
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions files/image_config/interfaces/interfaces-config.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/bash

ifdown -a -X eth0
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/interfaces.j2 >/etc/network/interfaces
ifup -a -X eth0

NEW_MGMT_IP=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_mgmt_interface["addr"]'`
NEW_MGMT_MASK=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_mgmt_interface["mask"]'`

ifconfig eth0 $NEW_MGMT_IP netmask $NEW_MGMT_MASK
[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid

service networking restart
ifdown lo && ifup lo

0 comments on commit eb99886

Please sign in to comment.