AdGuardHome on GL routers

Background - I’m not a programmer but I do have a background in systems so I can (sorta) hack together some scripts. I mostly use the beta version of AGH and it was getting annoying having to follow the process above every time a new release came out so I set out to create a script to automate some functions. Well, that automation grew significantly, to the point that I felt that I’d like to dump my script into github and share with this community, hoping for the best.

Script Features

  1. Checks for dependencies:
    a. Free disk space to upgrade
    b. Properly installed and running version of AGH
    c. Checks for the correct model and fails if you aren’t running the correct version (supports MT1300 only right now)
  2. Downloads and parses the available beta and release versions of AGH comparing to your current version and presents an output of the same
  3. Allows you to switch from beta to release and vice versa or just upgrade to the latest version of your chosen branch (if available)
  4. Will fetch the correct go binary based on your model number
  5. Extracts the tarball (with a check that it can find the new binary file)
  6. Creates a backup of your existing binary and config files
  7. Disables your AGH service (temporarily)
  8. Copies new AGH binary into place
  9. Reloads AGH service
  10. Cleans up temp files created
  11. Status along the way with error handling and graceful exiting if something fails (e.g. cleanup of temp files)


  1. I’m looking for feedback on other models and their correct go binary. Specifically - cat /proc/gl-hw-info/model along with the associated url to your binary from here. You can check for the correct binary using the process outlined here.
  2. As stated, I’m not a programmer and likely broke all sorts of best practices with my code (but it works for me!). If you are interested in helping clean up the code to be more efficient and align with best practices, let me know. I’m sure there are a zillion opportunities here. :slight_smile:
  3. Be kind in your feedback

The script can be found here: GitHub - phantasm22/AdGuardHome-updater: Shell script to update AdGuardHome on GL.iNet routers

1 Like