mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
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
This commit is contained in:
parent
5221767a70
commit
35dc4800e0
1 changed files with 2 additions and 2 deletions
|
@ -684,13 +684,13 @@ setStaticIPv4() {
|
||||||
elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then
|
elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then
|
||||||
# If it exists,
|
# If it exists,
|
||||||
IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}
|
IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}
|
||||||
|
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
|
||||||
# check if the desired IP is already set
|
# 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"
|
echo -e " ${INFO} Static IP already configured"
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# Put the IP in variables without the CIDR notation
|
# Put the IP in variables without the CIDR notation
|
||||||
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
|
|
||||||
CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/)
|
CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/)
|
||||||
# Backup existing interface configuration:
|
# Backup existing interface configuration:
|
||||||
cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig
|
cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig
|
||||||
|
|
Loading…
Reference in a new issue