mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 06:48:07 +00:00
Fix static IP not set
Signed-off-by: Stephan Pillhofer <43667664+StephanPillhofer@users.noreply.github.com>
This commit is contained in:
parent
f1b15f7e92
commit
06cf7afbc2
@ -828,8 +828,11 @@ It is also possible to use a DHCP reservation, but if you are going to do that,
|
|||||||
|
|
||||||
# Configure networking via dhcpcd
|
# Configure networking via dhcpcd
|
||||||
setDHCPCD() {
|
setDHCPCD() {
|
||||||
# Check if the IP is already in the file
|
# Regex for matching a non-commented static ip address setting
|
||||||
if grep -q "${IPV4_ADDRESS}" /etc/dhcpcd.conf; then
|
local regex="^[ \t]*static ip_address[ \t]*=[ \t]*${IPV4_ADDRESS}[ \t]*$"
|
||||||
|
|
||||||
|
# Check if static IP is already set in file
|
||||||
|
if grep -xq "${regex}" /etc/dhcpcd.conf; then
|
||||||
printf " %b Static IP already configured\\n" "${INFO}"
|
printf " %b Static IP already configured\\n" "${INFO}"
|
||||||
# If it's not,
|
# If it's not,
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user