Fix static IP checking on Fedora

This bug was introduced by #1758 where the CIDR was removed from the static IP check.
The CIDR was acting as a boundary so we need to test for a boundary or a slash character.

Signed-off-by: bcambl <blayne@blaynecampbell.com>
This commit is contained in:
bcambl 2018-04-22 13:53:15 -06:00
parent 0833d0d8d5
commit 1d8ea9e869

View file

@ -689,7 +689,7 @@ setStaticIPv4() {
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/) 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 "${IPADDR}" "${IFCFG_FILE}"; then if grep -Eq "${IPADDR}(\\b|\\/)" "${IFCFG_FILE}"; then
echo -e " ${INFO} Static IP already configured" echo -e " ${INFO} Static IP already configured"
# Otherwise, # Otherwise,
else else