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

Startup script won't run

lbradio

Regular Contributor
Hello guys, I need some help.

ASUS RT-AC68U with Merlin's build.

I placed the following script in /jfss/scripts/ , and afterwards chmod it to a+rx.
It is just a simple 'force-dns' script, which prevents users from using their own DNS server.
(scripts made with VI)

When I run the script manually, It runs like expected, but the script is not called at reboot. Not even 000nat-start in the /tmp folder.

My questions:
- Will every script in /jfss/scripts automatically be called at reboot, or should I make a change elsewhere to call the script at startup
- If every script is called at reboot, what could be wrong?


#!/bin/sh
touch /tmp/000nat-start
iptables -I PREROUTING -t nat -p udp -s `nvram get lan_ipaddr`/`nvram get lan_netmask` ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` --dport 53 -j DNAT --to-destination `nvram get lan_ipaddr`
touch /tmp/000nat-started
 
Hello guys, I need some help.

ASUS RT-AC68U with Merlin's build.

I placed the following script in /jfss/scripts/ , and afterwards chmod it to a+rx.
It is just a simple 'force-dns' script, which prevents users from using their own DNS server.
(scripts made with VI)

When I run the script manually, It runs like expected, but the script is not called at reboot. Not even 000nat-start in the /tmp folder.

My questions:
- Will every script in /jfss/scripts automatically be called at reboot, or should I make a change elsewhere to call the script at startup
- If every script is called at reboot, what could be wrong?


#!/bin/sh
touch /tmp/000nat-start
iptables -I PREROUTING -t nat -p udp -s `nvram get lan_ipaddr`/`nvram get lan_netmask` ! -d `nvram get lan_ipaddr`/`nvram get lan_netmask` --dport 53 -j DNAT --to-destination `nvram get lan_ipaddr`
touch /tmp/000nat-started

Only these script names will auto-execute:

https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

I personally use firewall-start to 'force DNS'

Regards,
 
Just that simple. Did read that article, but still messed up.
It is working. Thanks for the quick support.
 

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