Posted: Sat Aug 11, 2018 17:18 Post subject: Overwrite dnsmasq.conf?
Hello!
First, I'm quite new to custom router firmware, so please don't blame me for not knowing how that works.
How can I overwrite the dnsmasq.conf? Everytime I click "apply settings" or reboot the router it will overwrite the /tmp/dnsmasq.conf (which is logical because it's in /tmp).
I know there is a "Additional DNSMasq Options" option under "Services", but it only appends the options instead of overwriting them. So I cannot change something which was already configured by the automatically created config.
My dd-wrt version: v3.0-r36527 std (08/09/1
Device: TL-WR1043ND V2
Joined: 18 Mar 2014 Posts: 12837 Location: Netherlands
Posted: Sat Aug 11, 2018 18:10 Post subject:
)ptions placed in additional config should precede the options already in the conf file (but I have never checked if it really does)
If it does not you can stop dnsmasq with:
Code:
stopservice dnsmasq
and start it with your own conf file:
Code:
dnsmasq --conf-file=/tmp/myown_dnsmasq.conf
If you have an usb stick you can of course place your own conf file there or you can just write your own at startup to /tmp. Below an example, place in Administratio/Commands and save as Startup:
Joined: 18 Mar 2014 Posts: 12837 Location: Netherlands
Posted: Sun Aug 12, 2018 8:10 Post subject:
First test everything form the command line, otherwise you might lock yourself out when putting it in startup and it is not working and the only thing you could do then is reset.
Start with a shebang:
Code:
#!/bin/sh
Add commentary code with a:
Code:
#
After
Code:
stopservice dnsmasq
add
Code:
sleep 10
to wait 10 seconds until dnsmasq is really stopped (maybe 2 or 5 would also be sufficient, and more sophisticated would maybe something like: "while pidof dnsmasq; do sleep 2; done".
But writing shell scripts is not my daily bread and butter so not take my word for granted and test everything before adding to startup. _________________ Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399 Install guide R7800/XR500:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614 Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087