Asuswrt-Merlin is an enhanced version of Asuswrt, the firmware used by Asus's modern wifi routers. It is a third party alternative firmware for Asus routers, with a special emphasis on tweaks and fixes rather than radical changes or collecting as many features as possible.


Topics associated

  • Page:
    bash case statements — Sometimes we may wish to take different paths based upon a variable matching a series of patterns. We could use a series of if and elif statements but that would soon grow to be unwieldily. Fortunately there is a case statement which can make things cleaner. It's a little hard to explain so here are some examples to illustrate:
  • Page:
    bash if statement — bash if statement is one of the key features you can cover various use cases
  • Page:
    bash pause — pause function can be easily implemented in bash by read function.
  • Page:
    How to add cron job on Asuswrt Merlin Wifi Router cru enables you to check/add/delete cron job on your Asuswrt Merline Wifi Router. Because Asuswrt does not save all the cron job by the limited storage, you should add cron job at /jfss/scripts/init-start, so the cronjob will be done as designed.
  • Page:
    Perfect solutions when you face "Argument list too long" The reason this occurs is because bash actually expands the asterisk to every matching file, producing a very long command line. There are some workarounds for cp, mv, rm by find, xargs, and etc.
  • Page:
    Reboot server if Google DNS does not respond — The below sh script trigger rebooting server if Google DNS does not respond
  • Page:
    reboot_if_ping_does_not_work — Sometimes servers need to update its status or reboot by the condition to return its status to the best working environment to remove junk process or something like that. You can check that status by shell script.
  • Page:
    sed - replacing a string in a text file on bash "sed" provides a method for searching-and-replacing a text in a specified file in bash, so you can make some scripts which can replace necessary things easily.
  • Page:
  • Page:
    tee - append to a file using the tee command tee is a command-line utility in Linux that reads from the standard input and writes to both standard output and one or more files at the same time.
  • Page:
  • Page:
    Thread implementation in shell script When you execute a Bash script, it will at maximum use a single CPU thread, unless you start subshells/threads. If your machine has at least two CPU threads, you will be able to max-out CPU resources using multi-threaded scripting in Bash. The reason for this is simple; as soon as a secondary ‘thread’ (read: subshell) is started, then that subsequent thread can (and often will) use a different CPU thread.

  • No labels