What's new

[SOLVED] 378.50+ not running post-mount script

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

Vinicius Cordeiro

New Around Here
Hi,

After update to 378.50+ and did a factory reset, installed entware again, etc, now the router is not running /jffs/scripts/post-mount, then every boot I need to manually create entware link to /opt

Code:
admin@RT-AC66R:/jffs/scripts# ls -la
drwxr-xr-x    2 admin    root             0 Mar  1 23:51 .
drwxr-xr-x    5 admin    root             0 Dec 31  1969 ..
-rwxrwxrwx    1 admin    root            80 Mar  1 23:51 post-mount
-rwxrwxrwx    1 admin    root            53 Mar  1 23:51 services-start
-rwxrwxrwx    1 admin    root            43 Mar  1 23:51 services-stop
admin@RT-AC66R:/jffs/scripts# cat post-mount
#!/bin/sh

if [ $1 = "/tmp/mnt/RT-AC66R" ]
then
  ln -sf $1/entware /tmp/opt
fi
 
After update to 378.50+ and did a factory reset, installed entware again, etc, now the router is not running /jffs/scripts/post-mount, then every boot I need to manually create entware link to /opt
Hi,

Did you enable the option "Enable JFFS custom scripts and configs" under Administration/System? :rolleyes:
This new since .50 version of Merlins firmware.

With kind regards
Joe :cool:
 
Just a small comment.

I notice that your file permissions for the scripts are
-rwxrwxrwx

The last set rwx allows world write, which would allow a hacker if they gained access to your device via a hole in dnsmasq (running as nobody) to change the script. From a security point, this is wrong.

Since these scripts are always run by admin, you should change the permissions to the minimum required with
chmod 700 /jffs/scripts/*
 
Hi,

Did you enable the option "Enable JFFS custom scripts and configs" under Administration/System? :rolleyes:
This new since .50 version of Merlins firmware.

With kind regards
Joe :cool:

Hi @joegreat
Thank you so much!!! You're right! That option was not present before 378.50 versions, now everything is ok!

Just a small comment.

I notice that your file permissions for the scripts are
-rwxrwxrwx

The last set rwx allows world write, which would allow a hacker if they gained access to your device via a hole in dnsmasq (running as nobody) to change the script. From a security point, this is wrong.

Since these scripts are always run by admin, you should change the permissions to the minimum required with
chmod 700 /jffs/scripts/*

Hi @coldwizard

I didn't change this and probably is default on firmware, but I'm changing it right now!
 

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!

Members online

Top