From 35dc4800e07135af1894ff817b8e51d2cf302932 Mon Sep 17 00:00:00 2001 From: mettacrawler Date: Sun, 5 Nov 2017 15:28:44 -0500 Subject: [PATCH] basic-install.sh - no CIDR in ifcfg-* Do not expect CIDR format IP addresses in /etc/sysconfig/network-scripts/ifcfg-* files as it is not a requirement. Expect only: IPADDR=10.10.10.10 Do not expect: IPADDR=10.10.10.10/24 --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 647661f8..e7c3f189 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -684,13 +684,13 @@ setStaticIPv4() { elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then # If it exists, IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE} + IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/) # check if the desired IP is already set - if grep -q "${IPV4_ADDRESS}" "${IFCFG_FILE}"; then + if grep -q "${IPADDR}" "${IFCFG_FILE}"; then echo -e " ${INFO} Static IP already configured" # Otherwise, else # Put the IP in variables without the CIDR notation - IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/) CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/) # Backup existing interface configuration: cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig