How to confirm services-start script was called?

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

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!

[email protected]:/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
[email protected]:/jffs/scripts#

[email protected]:/jffs/scripts# cat services-start
#!/bin/sh
# Disable LAN port 1-4
/jffs/scripts/disablelan
[email protected]:/jffs/scripts#

[email protected]:/jffs/scripts# cat disablelan
ifconfig eth1 down
ifconfig eth2 down
ifconfig eth3 down
ifconfig eth4 down
[email protected]:/jffs/scripts#
 

dave14305

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

RMerlin

Asuswrt-Merlin dev
Executed scripts are logged into the system log.
 

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