X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fstx-puppet%2Fapply_network_config_poky.sh;h=8357378fcff6204ccbbbd7405a8311bbe7882438;hb=refs%2Fchanges%2F34%2F3634%2F1;hp=9d182be979fef5eb1efacf5744e342617ccc361a;hpb=57fdea704bd62af847872c40508f00aa1d7cac60;p=pti%2Frtp.git diff --git a/meta-stx/recipes-support/puppet/files/stx-puppet/apply_network_config_poky.sh b/meta-stx/recipes-support/puppet/files/stx-puppet/apply_network_config_poky.sh index 9d182be..8357378 100755 --- a/meta-stx/recipes-support/puppet/files/stx-puppet/apply_network_config_poky.sh +++ b/meta-stx/recipes-support/puppet/files/stx-puppet/apply_network_config_poky.sh @@ -280,16 +280,23 @@ function sysinv_agent_lock { # synchronize with sysinv-agent audit sysinv_agent_lock $ACQUIRE_LOCK -# now copy the puppet changed interfaces to /etc/network/interfaces -do_mv /var/run/interfaces.puppet /etc/network/interfaces - -# now restart networking service -/etc/init.d/networking restart +# check if this is a duplicated configuration +if ! diff -I '^#' "/var/run/interfaces.puppet" "/etc/network/interfaces" > /dev/null; then + # now copy the puppet changed interfaces to /etc/network/interfaces + do_mv /var/run/interfaces.puppet /etc/network/interfaces + + # now restart networking service + /etc/init.d/networking restart + + sleep 5 +else + # need to remove this file also + do_rm /var/run/interfaces.puppet +fi -sleep 5 # workaround the loopback label addresses cannot be configured as scope of host -ip addr show lo | egrep "inet.*lo:" > /tmp/loop$$ +ip addr show lo | egrep "inet.*global.*lo:" > /tmp/loop$$ while read addr_info; do echo $addr_info