basic_install: If a static interface is already set up we are done

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider 2019-02-05 09:06:57 +00:00
parent b5c7657e01
commit dc91d4b1f9

View file

@ -873,6 +873,13 @@ setStaticIPv4() {
# Local, named variables # Local, named variables
local IFCFG_FILE local IFCFG_FILE
local CONNECTION_NAME local CONNECTION_NAME
# If a static interface is already configured, we are done.
if [[ -r "/etc/sysconfig/network/ifcfg-${PIHOLE_INTERFACE}" ]]; then
if grep -q '^BOOTPROTO=.static.' "/etc/sysconfig/network/ifcfg-${PIHOLE_INTERFACE}"; then
return 0
fi
fi
# For the Debian family, if dhcpcd.conf exists, # For the Debian family, if dhcpcd.conf exists,
if [[ -f "/etc/dhcpcd.conf" ]]; then if [[ -f "/etc/dhcpcd.conf" ]]; then
# configure networking via dhcpcd # configure networking via dhcpcd