mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +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
|
||||
# If it exists,
|
||||
IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}
|
||||
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
|
||||
# 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"
|
||||
# Otherwise,
|
||||
else
|
||||
# Put the IP in variables without the CIDR notation
|
||||
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
|
||||
CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/)
|
||||
# Backup existing interface configuration:
|
||||
cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig
|
||||
|
|
Loading…
Reference in a new issue