What's new

services-start script help please

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

speedbump

Regular Contributor
I know I am missing something because I have this problem on AC68U (374.42) and N66U (35_4 sdk5). I am at a loss, any help will be appreciated.

The script will run if I manually run it but it does not auto start.

I have a copy of the file in windows, I ssh into the router, open vi, do a copy from text file and paste into the vi, save the file.

I have tried setting the sleep even to 20 and no banana.

then I do:
chmod a+rx /jffs/scripts/*

This is what I have:

admin@RT-AC68U-C378:/tmp/home/root# ls -l /jffs/scripts
-rwxrwxrwx 1 admin root 1117 May 11 20:39 services-start


file contents:
#!/bin/sh
sleep 5
echo "server=/netflix.com/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/netflix.com/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/pbs.org/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/pbs.org/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/pbskids.org/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/pbskids.org/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/bbc.co.uk/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/bbc.co.uk/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/4ondemand.com/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/4ondemand.com/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/itv.com/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/itv.com/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/youtube.com/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/youtube.com/54.229.171.243" >> /tmp/etc/dnsmasq.conf
echo "server=/hulu.com/21.23.43.50" >> /tmp/etc/dnsmasq.conf
echo "server=/hulu.com/54.229.171.243" >> /tmp/etc/dnsmasq.conf
killall dnsmasq
dnsmasq -c 1500 --log-async -n
 
Wouldn't this be better way:

/jffs/configs/dnsmasq.conf.add
Code:
cache-size=1500
no-poll
server=/netflix.com/21.23.43.50
server=/netflix.com/54.229.171.243
server=/pbs.org/21.23.43.50
server=/pbs.org/54.229.171.243
server=/pbskids.org/21.23.43.50
server=/pbskids.org/54.229.171.243
server=/bbc.co.uk/21.23.43.50
server=/bbc.co.uk/54.229.171.243
server=/4ondemand.com/21.23.43.50
server=/4ondemand.com/54.229.171.243
server=/itv.com/21.23.43.50
server=/itv.com/54.229.171.243
server=/youtube.com/21.23.43.50
server=/youtube.com/54.229.171.243
server=/hulu.com/21.23.43.50
server=/hulu.com/54.229.171.243
 
Wouldn't this be better way:

/jffs/configs/dnsmasq.conf.add
Code:
cache-size=1500
no-poll
server=/netflix.com/21.23.43.50
server=/netflix.com/54.229.171.243
server=/pbs.org/21.23.43.50
server=/pbs.org/54.229.171.243
server=/pbskids.org/21.23.43.50
server=/pbskids.org/54.229.171.243
server=/bbc.co.uk/21.23.43.50
server=/bbc.co.uk/54.229.171.243
server=/4ondemand.com/21.23.43.50
server=/4ondemand.com/54.229.171.243
server=/itv.com/21.23.43.50
server=/itv.com/54.229.171.243
server=/youtube.com/21.23.43.50
server=/youtube.com/54.229.171.243
server=/hulu.com/21.23.43.50
server=/hulu.com/54.229.171.243



What's the advantage ?
why is it better ?
 
What's the advantage ?
why is it better ?

Using dnsmasq.conf.add will ensure that whenever the dnsmasq server is restarted, your changes will be applied to the config.

With your method, if dnsmasq gets restarted after the router has completed booting and obtaining a WAN connection, it will lose all your changes.
 
What's the advantage ?
why is it better ?
Either will work. It just seems a lot clearer and easier to edit (less typo's). Also, you're making the changes before dnsmasq is started so you don't have to kill it and start it again. It's just more elegant IMHO.:)

+ What RMerlin said.
 
Last edited:
yea, dnsmasq.conf.add should have been my first suggestion, really. far superior method to append to the config
 
Wouldn't this be better way:

/jffs/configs/dnsmasq.conf.add
Code:
cache-size=1500
no-poll
server=/netflix.com/21.23.43.50
server=/netflix.com/54.229.171.243
server=/pbs.org/21.23.43.50
server=/pbs.org/54.229.171.243
server=/pbskids.org/21.23.43.50
server=/pbskids.org/54.229.171.243
server=/bbc.co.uk/21.23.43.50
server=/bbc.co.uk/54.229.171.243
server=/4ondemand.com/21.23.43.50
server=/4ondemand.com/54.229.171.243
server=/itv.com/21.23.43.50
server=/itv.com/54.229.171.243
server=/youtube.com/21.23.43.50
server=/youtube.com/54.229.171.243
server=/hulu.com/21.23.43.50
server=/hulu.com/54.229.171.243

OK I just tried this script and nothing worked not even google.com, it would not resolve any URL.

am I missing a trick ?

I assume that I did not need to do the chmod command as this adds to a config file.

thanks
 
Last edited:
did you move it to /jffs/configs rather than /jffs/scripts ?
 
Try removing "no-poll" from the file. I don't understand why you would want that anyway.
 
I also tried to make the file executable

admin@RT-AC68U-C378:/jffs/configs# ls -l
-rwxrwxrwx 1 admin root 538 May 13 2014 dnsmasq.conf.add

and same thing. After reboot, I can not resolve any URL not the ones listed and not any other ones.
 
don't know what that is, I just copied the script from what you posted...

Check the content of /etc/dnsmasq.conf to ensure your entries do get appended. Also check the System Log for any syntax error message.
 
Check the content of /etc/dnsmasq.conf to ensure your entries do get appended. Also check the System Log for any syntax error message.

Thanks, the file was appended but the log did not like the line with cache-size=1500, once I removed and just left the lines with server=..... it works like a charm :)
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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