1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

How to run a script with merlin?

Discussion in 'Asuswrt-Merlin' started by fitnesspmm, Aug 18, 2018.

  1. fitnesspmm

    fitnesspmm Occasional Visitor

    Joined:
    Jul 26, 2018
    Messages:
    20
    Hi,

    I received a script to run with Merlin where I don't know how to load it. What do I need to do?

    I've had a look around but I can't find a user guide anywhere.
     
    Last edited: Aug 18, 2018
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. AndreiV

    AndreiV Very Senior Member

    Joined:
    Aug 25, 2015
    Messages:
    523
    Location:
    UK
  4. fitnesspmm

    fitnesspmm Occasional Visitor

    Joined:
    Jul 26, 2018
    Messages:
    20
    I created the directory /jffs/scripts/ on the External Drive attached to my Router.

    I created a file called 'nat-start' and put it in the directory /jffs/scripts/

    So now it will automatically run everytime the router reboots?
     
  5. fitnesspmm

    fitnesspmm Occasional Visitor

    Joined:
    Jul 26, 2018
    Messages:
    20
    I have this line in my script

    chmod 0755 /jffs/scripts/services-start
    reboot

    Do I need to change the file name to services-start instead?
     
  6. fitnesspmm

    fitnesspmm Occasional Visitor

    Joined:
    Jul 26, 2018
    Messages:
    20
    Not working...
     
  7. Steffe

    Steffe Regular Contributor

    Joined:
    Aug 27, 2013
    Messages:
    70
    Try and read the wiki again.

    While Asuswrt-Merlin only adds a limited number of new features over the original firmware, a lot of customizations can be achieved through the use of user scripts. These will allow you to set up custom firewall rules, create jobs that can be run at scheduled intervals, or start new services.

    Those scripts are stored in the internal non-volatile flash in the JFFS partition. Support for these scripts must be enabled, under Administration -> System on the webui.
     
  8. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    27,760
    Location:
    Canada
    /jffs is a folder within the root of your router (in flash), it's not a directory on your hard disk.
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!