Hi there
some people wonder how to update the AdGuard Home version on devices like the Flint or Flint2. For your convenience, I created a script to automate this process. Make sure to read and understand this post before you go on!
Permanent feature
I added the option to make all changes permanent. The script therefore only needs to be executed once, the effects are then permanent. Even across firmware updates. On the downside, it might create trouble when you flash a way older firmware.
If everything fails, flashing using Uboot will fix it.
Dependencies
Currently, the update-process is only supported on devices using ARM64 or ARMv7 architecture.
This should affect most routers like the Flint or Flint2. If you are not sure about the architecture, you can run uname -m
to get the current one. It should say aarch64 or armv7l to be able to run my script.
I added some checks in my script as well, so it should be pretty safe to run.
Download
You can find it in my repo located on GitHub:
Quick run without downloading
You can run it without cloning the repository by using the following command:
wget -O update-adguardhome.sh https://raw.githubusercontent.com/Admonstrator/glinet-adguard-updater/main/update-adguardhome.sh && sh update-adguardhome.sh
Running on devices with low free space
You can use --ignore-free-space
to ignore the free space check. This is useful for devices with low free space like the AXT1800.
In that case, there will be no backup of the original files and the script will not check if there is enough free space to download the new files. Could potentially break your router if there is not enough free space.
Enabling query logging
By default, AdGuard Home is not able to save the query log to a file. This is to prevent running out of space on the router and prevent wearing out the flash memory. This script can enable query logging to file by setting the querylog
option in the AdGuard Home configuration file. You will asked if you want to enable query logging after the update.
If you want to enable query logging to file without updating AdGuard Home, you can run the following command:
sed -i '/^querylog:/,/^[^ ]/ s/^ file_enabled: .*/ file_enabled: true/' /etc/AdGuardHome/config.yaml
/etc/init.d/adguardhome restart
For disabling query logging to file, you can run the following command:
sed -i '/^querylog:/,/^[^ ]/ s/^ file_enabled: .*/ file_enabled: false/' /etc/AdGuardHome/config.yaml
/etc/init.d/adguardhome restart
Selecting a release
By default, the script will install the latest stable release of AdGuard Home. You can use --select-release
to select a specific release. The script will ask you which release you want to install.
Disclaimer
This script is provided as is and without any warranty. Use it at your own risk.
It may break your router, your computer, your network or anything else.
It may even burn down your house You have been warned!
Reverting
Since AdGuard Home is deeply integrated into the firmware, it is difficult to revert the changes. Right now there is no automatic way to revert them. Resetting the router to factory settings will NOT revert the changes if you choose to make the installation persistent!
How to revert the changes manually by SSH:
-
Remove the line
/usr/bin/enable-adguardhome-update-check
from/etc/rc.local
. -
Execute
rm /usr/bin/enable-adguardhome-update-check
to remove the script. -
Remove the following lines from
/etc/sysupgrade.conf
:/root/AdGuardHome_backup.tar.gz
/etc/AdGuardHome
/usr/bin/AdGuardHome
/usr/bin/enable-adguardhome-update-check
/etc/rc.local
-
Stop the AdGuard Home service by executing
/etc/init.d/adguardhome stop
. -
Reset the AdGuard Home configuration by executing
rm -rf /etc/AdGuardHome
- this will remove all your settings and blocklists! -
Start the AdGuard Home service by executing
/etc/init.d/adguardhome start
.
A backup of the original files is located in the /root/
folder. The backup is named AdGuardHome_backup.tar.gz
.
If you still encounter issues after doing these steps, you can reset AdGuard Home to its original state by flashing the firmware again.