What's new

dnsmasq.postconf not working with merlin 386.1 on asus 66u_b1

  • 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!

gecongjie

Occasional Visitor
I tried the following content in /jffs/scripts/dnsmasq.postconf, none worked (/tmp/etc/dnsmasq.conf doesn't change).
#!/bin/sh​
CONFIG=$1​
source /usr/sbin/helper.sh​
pc_replace "cache-size=1500" "cache-size=10000" $CONFIG​
#!/bin/sh​
CONFIG=$1​
source /usr/sbin/helper.sh​
pc_replace "cache-size=1500" "cache-size=10000" /tmp/etc/dnsmasq.conf​
#!/bin/sh​
CONFIG=$1​
sed -i 's/cache-size=1500/cache-size=10000/g' $CONFIG​
#!/bin/sh​
CONFIG=$1​
sed -i 's/cache-size=1500/cache-size=10000/g' /tmp/etc/dnsmasq.conf​
After inputting helper.sh pc_replace "cache-size=1500" "cache-size=10000" /tmp/etc/dnsmasq.conf with putty, the file /tmp/etc/dnsmasq.conf does not change, however, the file does change after the command sed -i 's/cache-size=1500/cache-size=10000/g' /tmp/etc/dnsmasq.conf, but that doesn't have any real effect. Where did I go wrong?
 
I tried the following content in /jffs/scripts/dnsmasq.postconf, none worked (/tmp/etc/dnsmasq.conf doesn't change).
#!/bin/sh​
CONFIG=$1​
source /usr/sbin/helper.sh​
pc_replace "cache-size=1500" "cache-size=10000" $CONFIG​
#!/bin/sh​
CONFIG=$1​
source /usr/sbin/helper.sh​
pc_replace "cache-size=1500" "cache-size=10000" /tmp/etc/dnsmasq.conf​
#!/bin/sh​
CONFIG=$1​
sed -i 's/cache-size=1500/cache-size=10000/g' $CONFIG​
#!/bin/sh​
CONFIG=$1​
sed -i 's/cache-size=1500/cache-size=10000/g' /tmp/etc/dnsmasq.conf​
After inputting helper.sh pc_replace "cache-size=1500" "cache-size=10000" /tmp/etc/dnsmasq.conf with putty, the file /tmp/etc/dnsmasq.conf does not change, however, the file does change after the command sed -i 's/cache-size=1500/cache-size=10000/g' /tmp/etc/dnsmasq.conf, but that doesn't have any real effect. Where did I go wrong?
Did you set the file properties to 755?
 
Make sure JFFS scripts and custom configs is enabled in the GUI. Make sure your script is executable. Make sure the line endings are correct if you uploaded the file from a PC.
Bash:
nvram set jffs2_scripts=1
nvram commit
chmod u+x /jffs/scripts/dnsmasq.postconf
dos2unix /jffs/scripts/dnsmasq.postconf
service restart_dnsmasq
 
Make sure JFFS scripts and custom configs is enabled in the GUI. Make sure your script is executable. Make sure the line endings are correct if you uploaded the file from a PC.
Bash:
nvram set jffs2_scripts=1
nvram commit
chmod u+x /jffs/scripts/dnsmasq.postconf
dos2unix /jffs/scripts/dnsmasq.postconf
service restart_dnsmasq
1613565437492.png

My scripts folder looks like this and all my other scripts are working fine. But you do make me notice that this is the only script with a dot. I made the file in WinSCP. Should I try touch?

Just noticed your codes. Trying now.
 
View attachment 30874
My scripts folder looks like this and all my other scripts are working fine. But you do make me notice that this is the only script with a dot. I made the file in WinSCP. Should I try touch?

Just noticed your codes. Trying now.
If you ran the commands I posted and it still didn’t update correctly, there’s something wrong with your script content, most likely. Post the current contents of your script.
 
If you ran the commands I posted and it still didn’t update correctly, there’s something wrong with your script content, most likely. Post the current contents of your script.
I didn't run thoese nvram commands for I know my other scripts are working. Now the dnsmasq.postconf WORKS! Thank you, man! chmod u+x is to set the permission, right? I did that before. The only thing I did not do is dos2unix. What is this command?
 
I didn't run thoese nvram commands for I know my other scripts are working. Now the dnsmasq.postconf WORKS! Thank you, man! chmod u+x is to set the permission, right? I did that before. The only thing I did not do is dos2unix. What is this command?
It converts line endings from Windows to Unix format.
 
So it was a format problem. How do I make sure this doesn't happen again? The line endings look the same in Notepad++
If you create a new file using WinSCP's internal editor it should be in the correct format. If you create it using Notepad++ you need to make sure the EOL Conversion is set to UNIX/OSX Format.

Untitled.png
 

Similar threads

Latest 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!
Top