mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge pull request #1758 from mettacrawler/fix-for-RHELish-ifcfg
basic-install.sh - no CIDR in ifcfg-*
This commit is contained in:
commit
a1d6ef04ec
1 changed files with 2 additions and 2 deletions
|
@ -690,13 +690,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