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

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

gecongjie

New Around Here
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?
 

bbunge

Very Senior Member
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?
 

dave14305

Part of the Furniture
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
 

gecongjie

New Around Here
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.
 

dave14305

Part of the Furniture
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.
 

gecongjie

New Around Here
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?
 

dave14305

Part of the Furniture
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.
 

ColinTaylor

Part of the Furniture
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

Sign Up For SNBForums Daily Digest

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