diff --git a/dockers/docker-fpm-quagga/base_image_files/bgp_neighbor b/dockers/docker-fpm-quagga/base_image_files/bgp_neighbor deleted file mode 100755 index d6bd67a0a02d..000000000000 --- a/dockers/docker-fpm-quagga/base_image_files/bgp_neighbor +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -e - -usage(){ - echo "Usage: $0 " - exit 255 -} - -[[ $# -ne 2 ]] && usage - -COMMAND=$1 -NEIGHBOR_IP=$2 - -if [ "$COMMAND" == "shutdown" ]; then - CMD_PREFIX="" -elif [ "$COMMAND" == "startup" ]; then - CMD_PREFIX="no" -else - usage -fi - -ASN=`vtysh -c "show ip bgp summary" | sed -n "s/.*AS number \([0-9]\+\).*/\1/p"` -if [ -z "$ASN" ]; then - exit 255 -fi - -[ -f /etc/sonic/bgp_admin.yml ] || echo "bgp_admin_state:" > /etc/sonic/bgp_admin.yml - -# Operate on all ipv4 neighbors when "neighbor_ip" = 0.0.0.0 -if [ "$NEIGHBOR_IP" == "0.0.0.0" ] ; then - for NEIGHBOR in `vtysh -c "show run" | grep nei | grep -oE "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | sort | uniq`; do - vtysh -c "configure terminal" -c "router bgp $ASN" -c "$CMD_PREFIX neighbor $NEIGHBOR shutdown" - - # Save admin state in config file - sed -i "/^\s*$NEIGHBOR:/d" /etc/sonic/bgp_admin.yml - if [ "$COMMAND" == "startup" ]; then - echo " $NEIGHBOR: on" >> /etc/sonic/bgp_admin.yml - else - echo " $NEIGHBOR: off" >> /etc/sonic/bgp_admin.yml - fi - done - -else - # Examine bgp neighbor exists first - vtysh -c "show ip bgp neighbor $NEIGHBOR_IP" | grep -q "BGP neighbor is" - - vtysh -c "configure terminal" -c "router bgp $ASN" -c "$CMD_PREFIX neighbor $NEIGHBOR_IP shutdown" - - # Save admin state in config file - sed -i "/^\s*$NEIGHBOR_IP:/d" /etc/sonic/bgp_admin.yml - if [ "$COMMAND" == "startup" ]; then - echo " $NEIGHBOR_IP: on" >> /etc/sonic/bgp_admin.yml - else - echo " $NEIGHBOR_IP: off" >> /etc/sonic/bgp_admin.yml - fi -fi diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 26f59bf94aad..dad2510ce756 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -29,8 +29,11 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then exit 0 fi - # Try to take minigraph saved during installation - if [ -f /host/minigraph.xml ]; then + # Try to take old configuration saved during installation + if [ -d /host/old_config ]; then + rm -f /host/old_config/sonic_version.yml + mv -f /host/old_config/* /etc/sonic/ + elif [ -f /host/minigraph.xml ]; then mv /host/minigraph.xml /etc/sonic/ else cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/ diff --git a/rules/docker-fpm-quagga.mk b/rules/docker-fpm-quagga.mk index 1e95c96e001b..a9c0511ba173 100644 --- a/rules/docker-fpm-quagga.mk +++ b/rules/docker-fpm-quagga.mk @@ -11,4 +11,3 @@ $(DOCKER_FPM_QUAGGA)_RUN_OPT += --net=host --privileged -t $(DOCKER_FPM_QUAGGA)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_FPM_QUAGGA)_BASE_IMAGE_FILES += vtysh:/usr/bin/vtysh -$(DOCKER_FPM_QUAGGA)_BASE_IMAGE_FILES += bgp_neighbor:/usr/bin/bgp_neighbor diff --git a/src/sonic-utilities b/src/sonic-utilities index c1b48a6a28f9..0ad528043019 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit c1b48a6a28f9897ebfebf9989b5cb4a472cf1967 +Subproject commit 0ad52804301903664dfe8f84ef1666101c950cd2