Fix bug in ip-in-use test

Need grep -wF instead of grep -w for IP test to avoid spurious match
against broadcast address in ifconfig output.
This commit is contained in:
William Erik Baxter
2022-12-04 05:47:15 -06:00
parent 0ee17be875
commit ec18847f3e
3 changed files with 3 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ validate_ip() {
error_exit "Invalid: (${TEST_IP})"
fi
done
if ifconfig | grep -qw "${TEST_IP}"; then
if ifconfig | grep -qwF "${TEST_IP}"; then
warn "Warning: IP address already in use (${TEST_IP})."
else
info "Valid: (${IP})."