Fix static IP not set because of in-line comment in dhcpcd.conf (#4998)

pull/4999/head
Dan Schaper 2 years ago committed by GitHub
commit f91606bb17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -829,10 +829,10 @@ It is also possible to use a DHCP reservation, but if you are going to do that,
# Configure networking via dhcpcd
setDHCPCD() {
# Regex for matching a non-commented static ip address setting
local regex="^[ \t]*static ip_address[ \t]*=[ \t]*${IPV4_ADDRESS}[ \t]*$"
local regex="^[ \t]*static ip_address[ \t]*=[ \t]*${IPV4_ADDRESS}"
# Check if static IP is already set in file
if grep -xq "${regex}" /etc/dhcpcd.conf; then
if grep -q "${regex}" /etc/dhcpcd.conf; then
printf " %b Static IP already configured\\n" "${INFO}"
# If it's not,
else

Loading…
Cancel
Save