What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Trying to replace a DNSmasq entry that has quotes in the value

Ronv42

Senior Member
Today I almost completely finishined converting the custom DNSmasq configuration files to using Merlin's postconf script option. This will allow me to continue to use the web user interface while maintaining my customizations.

One thing I am having an issue with is this option:

Code:
dhcp-option=lan,252,"\n"

It's in double quotes and the pc_replace directive doesn't seem to work on the \n or the double quotes. Here is what I am trying to replace it with:

Code:
dhcp-option=lan,252,http://192.168.10.254/wpad.dat

Any suggestion on coding the pc_replace command? I have tried but my coding of expressions leave much to be desired..
 
Try using this instead:
Code:
sed -i 's|^dhcp-option=lan,252.*|dhcp-option=lan,252,http://192.168.10.254/wpad.dat|' $CONFIG
 
Last edited:
Try using this instead:
Code:
sed -i 's|^dhcp-option=lan,252.*|dhcp-option=lan,252,http://192.168.10.254/wpad.dat|' $CONFIG

Thank you. I see what you did...beginning line with the string of the option with wildcard at the end....
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top