diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4ab5c0e2..d9f41a3d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -997,9 +997,14 @@ setStaticIPv4() { # if an ifcfg config does not exists for the interface name, try the connection name via network manager if is_command nmcli && nmcli general status &> /dev/null; then CONNECTION_NAME=$(nmcli dev show "${PIHOLE_INTERFACE}" | grep 'GENERAL.CONNECTION' | cut -d: -f2 | sed 's/^System//' | xargs | tr ' ' '_') - if [[ -f "/etc/sysconfig/network-scripts/ifcfg-${CONNECTION_NAME}" ]];then + IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${CONNECTION_NAME} + if [[ -f "${IFCFG_FILE}" ]];then # If it exists, - IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${CONNECTION_NAME} + setIFCFG "${IFCFG_FILE}" + return 0 + else + printf " %b Warning: sysconfig network script not found. Creating ${IFCFG_FILE}\\n" "${INFO}" + touch "${IFCFG_FILE}" setIFCFG "${IFCFG_FILE}" return 0 fi