What's new

asuswrt-merlin jffs scripts not executed

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

phyrexianhulk

New Around Here
Hello everyone and thanks for your time,

I have an AC68U with merlin 3.0.0.4.374.43_2 running. Everything works quite well, except that the user scripts within /jffs/scripts/ do not get executed on a reboot.

This is the contents of /jffs/scripts/:
Code:
admin@MCP:/jffs/scripts# ls -lisha
      2      0 drwxr-xr-x    4 admin    root           0 Aug 23 10:15 .
      1      0 drwxr-xr-x    6 admin    root           0 Aug 23 10:21 ..
    808      1 -rwxrwxrwx    1 admin    root         902 Aug 17 20:55 backup.sh
    747      0 -rwxrwxrwx    1 admin    root         439 Aug 23 10:18 firewall-start
    906      0 -rwxrwxrwx    1 admin    root         268 Aug 23 10:16 init-start
    894      0 drwxrwxrwx    2 admin    root           0 Aug 23 10:15 logs
    826      0 -rwxrwxrwx    1 admin    root         241 Aug 23 10:17 services-start
    769      0 -rwxrwxrwx    1 admin    root         357 Aug 23 10:17 wan-start

Each of the scripts has this as its first entry, with the postfix according to its own name:

Code:
#!/bin/sh

DATE=$(date +"%Y-%m-%d-%H%M%S")
mkdir -p logs
touch logs/$DATE-firewall-start

When I execute them manually the logs/ directory fills up quite nicely:

Code:
admin@MCP:/jffs/scripts/logs# ls -lisha
    894      0 drwxrwxrwx    2 admin    root           0 Aug 23 10:31 .
      2      0 drwxr-xr-x    4 admin    root           0 Aug 23 10:15 ..
    922      0 -rw-rw-rw-    1 admin    root           0 Aug 23 10:31 2014-08-23-103107-init-start
    923      0 -rw-rw-rw-    1 admin    root           0 Aug 23 10:31 2014-08-23-103112-wan-start

However, after a reboot there are no new logs and the scripts do not get executed.

Am I doing something wrong? Did I miss something?

Thank you for your help!
 
Huh. Nice catch! You are right. I feel embarrassed now... :eek:

By the way, if anyone happens to need that kind of file touching mechanism, I improved the snippet to auto-include the filename of the current shell script:

Code:
#!/bin/sh

DIR=/tmp
DATE=$(date +"%Y-%m-%d-%H%M%S")
NAME=`basename $0`
mkdir -p $DIR
touch $DIR/$DATE-$NAME

This will give you filenames like these:

Code:
2011-01-01-010012-init-start
2011-01-01-010019-services-start
2011-01-01-010021-wan-start
2011-01-01-010025-firewall-start

Thanks again for your help!
 

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