Matthew Thode e5b4d98f81
Install NetworkManager to ensure consistent network bringup on centos
Sets up and enables NetworkManager.

In testing this was the only way to get the network to come up after
reboots on centos.

Change-Id: Iac8d982977982d886b29a8933b59dd3f55578769
2017-11-20 19:49:53 -06:00

20 lines
719 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# If the file /etc/sysconfig/network exists, set some options to make dhcp happy happy happy
if [ -e "/etc/sysconfig/network" ] ; then
# Give some time for the link to come up before configuring via dhcp
grep -v -q '^LINKDELAY' /etc/sysconfig/network && echo "LINKDELAY=${NETWORK_TIMEOUT}" >> /etc/sysconfig/network
# Persistently try to gain a dhcp address
grep -v -q '^PERSISTENT_DHCLIENT' /etc/sysconfig/network && echo 'PERSISTENT_DHCLIENT=yes' >> /etc/sysconfig/network
# since we are running on centos only no need to gate this behind an if statement
systemctl enable NetworkManager.service
fi