Do not try to parse sysconfig/network-scripts if initscrips is not installed

This commit is contained in:
Pavel Zhukov 2018-02-22 13:43:07 +01:00
parent e821f20f76
commit 5874b61d02

View File

@ -813,10 +813,14 @@ if [ -f /etc/sysconfig/networking/network ]; then
. /etc/sysconfig/networking/network . /etc/sysconfig/networking/network
fi fi
cd /etc/sysconfig/network-scripts ## it's possible initscripts package is not installed
CONFIG="${interface}" ## for example in container. Don't flood stderr then
need_config "${CONFIG}" if [ -d /etc/sysconfig/network-scripts ]; then
source_config >/dev/null 2>&1 cd /etc/sysconfig/network-scripts
CONFIG="${interface}"
need_config "${CONFIG}"
source_config >/dev/null 2>&1
fi;
# In case there's some delay in rebinding, it might happen, that the valid_lft drops to 0, # In case there's some delay in rebinding, it might happen, that the valid_lft drops to 0,
# address is removed by kernel and then re-added few seconds later by dhclient-script. # address is removed by kernel and then re-added few seconds later by dhclient-script.