What's new

How to confirm services-start script was called?

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

helloguys

Occasional Visitor
RT-AC86U, Merlin 386.1_2.

I want LAN port (eth1 - eth4) to be disabled after router reboot. I did the following:
1) "Enable JFFS custom scripts and configs" was set to "yes".
2) Created services-start and disablelan scripts in /jffs/scripts directory. Make the script executable.

The scripts work fine if I run them from CLI. However, they didn't seem to work if I reboot the router with "reboot" command (i.e. eth1 - eth4 was not disabled after reboot). What did I do wrong? Thanks!

admin@RT-AC86U-76C8:/jffs/scripts# ls -l
-rwxr-xr-x 1 admin root 77 Mar 10 20:57 disablelan
-rwxr-xr-x 1 admin root 59 Mar 10 21:15 services-start
admin@RT-AC86U-76C8:/jffs/scripts#

admin@RT-AC86U-76C8:/jffs/scripts# cat services-start
#!/bin/sh
# Disable LAN port 1-4
/jffs/scripts/disablelan
admin@RT-AC86U-76C8:/jffs/scripts#

admin@RT-AC86U-76C8:/jffs/scripts# cat disablelan
ifconfig eth1 down
ifconfig eth2 down
ifconfig eth3 down
ifconfig eth4 down
admin@RT-AC86U-76C8:/jffs/scripts#
 
Code:
# grep services-start /tmp/syslog.log*
/tmp/syslog.log:May  5 01:05:15 custom_script: Running /jffs/scripts/services-start
/tmp/syslog.log-1:May  5 01:05:14 custom_script: Running /jffs/scripts/services-start
/tmp/syslog.log-1:May  5 01:05:14 custom_script: Running /jffs/scripts/services-start
You can also add a line like touch /tmp/00services-startDONE at the end of the script to prove it ran. If you see the file in /tmp afterwards, you know it ran.

Put #!/bin/sh at the top of the disablelan script.
 
Last edited:
Executed scripts are logged into the system log.
 

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