From c6810a012406f4cc944f6123484c764c7da27df2 Mon Sep 17 00:00:00 2001 From: bcambl Date: Tue, 19 Jan 2021 22:58:05 -0600 Subject: [PATCH] touch sysconfig network script when absent sysconfig network scripts are missing on pure NetworkManager installs. This commit touches a placeholder to allow the network configuration to be generated and loaded via NetworkManager. Signed-off-by: bcambl --- automated install/basic-install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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