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!

scMerlin - service and script control menu for AsusWRT-Merlin

Discussion in 'Asuswrt-Merlin' started by Jack Yaz, Apr 23, 2019.

  1. Jack Yaz

    Jack Yaz Part of the Furniture

    Joined:
    Apr 20, 2017
    Messages:
    2,111
    v1.0.3
    Updated 2019-05-24

    Quick access to controlling services and scripts on your router

    scMerlin is free to use under the GNU General Public License version 3 (GPL 3.0).

    This project is hosted on GitHub

    Love the script and want to support future development? Any and all donations gratefully received! PayPal donation

    Example menu (options added/removed dynamically depending on which service(s) you have enabled on your router)
    [​IMG]

    Supported Models
    Models
    All modes supported by Asuswrt-Merlin. Models confirmed to work are below:
    • RT-AC68U
    • RT-AC86U
    • RT-AC3100
    Firmware versions
    You must be running firmware no older than:
    Installation
    Using your preferred SSH client/terminal, copy and paste the following command, then press Enter:
    Code:
    /usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/scmerlin/master/scmerlin.sh" -o "/jffs/scripts/scmerlin" && chmod 0755 /jffs/scripts/scmerlin && /jffs/scripts/scmerlin install
    
    Usage
    To launch the scmerlin menu after installation, use:
    Code:
    scmerlin
    If this does not work, you will need to use the full path:
    Code:
    /jffs/scripts/scmerlin
    
    Updating
    Launch scmerlin and select option u
     
    Last edited: May 25, 2019 at 3:54 AM
  2. Jack Yaz

    Jack Yaz Part of the Furniture

    Joined:
    Apr 20, 2017
    Messages:
    2,111
    Reserved
     
  3. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    Jack Yaz, just a big thank you for all these scripts recently!

    I think I may have posted a suggestion like this somewhere on the forums, or, did I just think I did? :)

    Either way, this is very useful to have for people that may not want to risk using certain commands themselves (or, not sure if the command is applicable for their router), just like me! :)

    Looking forward to suggestions from others that may be possible to incorporate here.

    I'll start!

    The save NVRAM variables commands that dump all our settings into a text file would be a nice addition. What do you and others think?

    Btw, I have been using this script for the last couple of days on my RT-AC86U and it works as advertised. Next, I'll try it on an RT-AC68U (384.11) and an RT-AC56U running john9527's LTS latest fork, 39E3.
     
    JohnSmith and Jack Yaz like this.
  4. Jack Yaz

    Jack Yaz Part of the Furniture

    Joined:
    Apr 20, 2017
    Messages:
    2,111
    Good point - I'll make SAMBA and FTP detect if they're enable in nvram

    EDIT: Done - no version change
     
    Last edited: Apr 23, 2019
    L&LD likes this.
  5. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    Jack Yaz, you may be too prolific! ;)

    I think you either need to have your own amtm-like menu/overview script or amtm should be incorporating some of these soon? :)

    I was at the PuTTY prompt a few minutes ago and I was typing YazFi, connmon, spdMerlin, ntpMerlin, and one more which shall remain unnamed for now, like a madman! Please, have a little mercy on our typing fingers, join forces with @thelonelycoder for possible inclusion in amtm asap. :D:D:D
     
  6. Kal1975

    Kal1975 Occasional Visitor

    Joined:
    Aug 6, 2017
    Messages:
    29
    Is this mainly to restart services/things that may be having issues and to stop Diversion in case you're navigating a site that requires ads to be enabled?

    I think maybe another good option for the amtm menu?
     
    QuikSilver likes this.
  7. Bamsefar

    Bamsefar Senior Member

    Joined:
    Oct 11, 2014
    Messages:
    235
    Or a script kind of thing that enables amtm and your script to be run inside web gui, like a very smal and basic text terminal in a tab inside the asus-rmerlin web gui?
     
  8. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    I don't think we can have that (it was tried a long time ago, but abandoned because of security issues), but, we may get the next best thing.

    I'll let Jack Yaz break that news though. Cool advances and even more user-friendly. Things are looking great on the scripting fronts. :)
     
    Swistheater likes this.
  9. Swistheater

    Swistheater Very Senior Member

    Joined:
    Jul 8, 2017
    Messages:
    804
    Location:
    Florida
    Don't feel like logging into the GUI just use SCMerlin….
     
  10. Jack Yaz

    Jack Yaz Part of the Furniture

    Joined:
    Apr 20, 2017
    Messages:
    2,111
    Not possible, as @L&LD says that used to exist in the firmware but was removed since it presented a significant security risk
     
    Swistheater and L&LD like this.
  11. underdose

    underdose Regular Contributor

    Joined:
    Dec 13, 2017
    Messages:
    51
    Location:
    Istanbul
    Might be better to add "Restart" at the beginning of each service. I know there's an explanation above and a confirmation step after, yet so many people will jump on the menus to see if they can find more commands under the selections just before realizing they just restart the selected service.

    <2cents.jpg>
     
    Grisu and Jack Yaz like this.
  12. Jack Yaz

    Jack Yaz Part of the Furniture

    Joined:
    Apr 20, 2017
    Messages:
    2,111
    That was my original design but i didn't like how it looked when i was striving for an alphabetical list. I've since tweaked that so I can revisit this
     
    L&LD and QuikSilver like this.
  13. steelskinz

    steelskinz Regular Contributor

    Joined:
    Mar 9, 2015
    Messages:
    142
    Location:
    France
    Thanks !
     
  14. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    A little report of how scMerlin helped me out yesterday. With a really useful and not just a 'nice to have' addition to our chest of router tools.

    I had about an hour where I was playing with the routers and was constantly jumping in and out of the GUI of my RT-AC86U and being SSH'd in with PuTTY on the same router. In the GUI, I was jumping between the Tools section and the added webpages of connmon, ntpMerlin, and an unnamed script/page when I saw the router GUI turn white and waiting for 5 minutes, using the back, refresh or any other buttons did not bring it back. I left it like this for about 15 minutes, closed the browser and logged out of PuTTY and tried to log back in later, but to no avail.

    I finally thought I will try to use scMerlin to reboot the router, but when it connected normally via PuTTY, and amtm and all other scripts responded instantly, I tried connecting again via the browser/GUI. Still no go.

    I then thought to use scMerlin to restart the Web Interface (httpd), option 3. and the browser instantly jumped to the login page. Success! :)

    I'm sure we'll be hearing a lot more of these types of stories. How a clean, straightforward script saves rebooting the router (and further, even more, drastic actions) by selectively restarting parts of the essential services the routers (and we) depend on.

    Thank you once again Jack Yaz!
     
  15. randomName

    randomName Senior Member

    Joined:
    Feb 25, 2012
    Messages:
    302
    Did you mean option 5?
     
  16. Butterfly Bones

    Butterfly Bones Very Senior Member

    Joined:
    Apr 10, 2017
    Messages:
    769
    Location:
    California central coast
    That command is so helpful with some of niggles with the AC86U. Some time ago that was suggested for a webGUI lockup by RMerlin I think. It worked so well for me that I added it as a cron job in /jffs/scripts/services-start. :cool:
    Code:
    0 */6 * * * /sbin/service restart_httpd #restart_httpd#
    I have not had webGUI logkups or the need for scheduled reboots or other panic S.M.A. efforts. I can see that as indeed being very useful for many.
     
    L&LD likes this.
  17. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    No, just checked again. :)

    Restart:
    Option 3. Web Interface (httpd)

    Edit: Btw! I don't see an option 5! I also force updated scMerlin, just to be sure. :)
     
    no_name and randomName like this.
  18. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    The first time it happened for me, and it may have been self-inflicted too! But scMerlin was there when I needed it. :)
     
    Butterfly Bones likes this.
  19. randomName

    randomName Senior Member

    Joined:
    Feb 25, 2012
    Messages:
    302

    In the OP it shows scMerlin and it's options. It shows option 3. Internet Connection. Option 5. Web Interface (httpd)

    ???


    [​IMG]
     
  20. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,116
    If that is the very first version (can't remember, I was doing some beta testing for Jack Yaz from the start), it has been updated a few times with no version changes. ;)
     
    randomName likes this.