mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
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 <blayne@blaynecampbell.com>
This commit is contained in:
parent
8e7670db41
commit
c6810a0124
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
# If it exists,
|
||||
IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${CONNECTION_NAME}
|
||||
if [[ -f "${IFCFG_FILE}" ]];then
|
||||
# If it exists,
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue