[Script] Update AdGuard Home

Since the repository changed to its own repository, I updated all commands.
Don’t worry if you are still using an outdated version of this script - update will happen automatically.

Awesome work! I can confirm that with a minor modification, siflower architecture devices (Opal/GL-SFT1200 for example) are also supported and work without issue, though I had to remove the /etc/AdGuardHome file that was there from the stock package to save some space.

The modification is just adding an extra elif and specifying the mipsle build of AdGuard Home, which is compatible with siflower

# ...
    elif [ "$ARCH" = "armv7l" ]; then
        log "SUCCESS" "Architecture: armv7"
        AGH_VERSION_NEW="https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_armv7.tar.gz"
    elif [ "$ARCH" = "mips" ]; then
        log "SUCCESS" "Architecture: mips"
        AGH_VERSION_NEW="https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_mipsle_softfloat.tar.gz"
# ...
2 Likes

On AdGuard Home version 0.107.49 (and higher), you will start to see a lot of timeout errors in your logs, like this:

Fri Jun  7 08:43:20 2024 daemon.warn dnsmasq[4731]: nameserver 127.0.0.1 refused to do a recursive query
Fri Jun  7 09:14:21 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:21.508565 [error] dnsproxy: 127.0.0.1:53: response received over udp: "exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:59025->127.0.0.1:53: i/o timeout"
Fri Jun  7 09:14:21 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:21.508706 [error] dnsproxy: upstream 127.0.0.1:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001038427s: exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:59025->127.0.0.1:53: i/o timeout
Fri Jun  7 09:14:21 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:21.508565 [error] dnsproxy: 127.0.0.1:53: response received over udp: "exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:56506->127.0.0.1:53: i/o timeout"
Fri Jun  7 09:14:21 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:21.508776 [error] dnsproxy: upstream 127.0.0.1:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001723775s: exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:56506->127.0.0.1:53: i/o timeout
Fri Jun  7 09:14:24 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:24.433914 [error] dnsproxy: [::1]:53: response received over udp: "exchanging with [::1]:53 over udp: read udp [::1]:46063->[::1]:53: i/o timeout"
Fri Jun  7 09:14:24 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:24.434041 [error] dnsproxy: upstream [::1]:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001156477s: exchanging with [::1]:53 over udp: read udp [::1]:46063->[::1]:53: i/o timeout
Fri Jun  7 09:14:24 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:24.434826 [error] dnsproxy: [::1]:53: response received over udp: "exchanging with [::1]:53 over udp: read udp [::1]:42492->[::1]:53: i/o timeout"
Fri Jun  7 09:14:24 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:14:24.434916 [error] dnsproxy: upstream [::1]:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.00137525s: exchanging with [::1]:53 over udp: read udp [::1]:42492->[::1]:53: i/o timeout
Fri Jun  7 09:15:51 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:51.106272 [error] dnsproxy: [::1]:53: response received over udp: "exchanging with [::1]:53 over udp: read udp [::1]:55499->[::1]:53: i/o timeout"
Fri Jun  7 09:15:51 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:51.106426 [error] dnsproxy: upstream [::1]:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.000838985s: exchanging with [::1]:53 over udp: read udp [::1]:55499->[::1]:53: i/o timeout
Fri Jun  7 09:15:51 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:51.106272 [error] dnsproxy: 127.0.0.1:53: response received over udp: "exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:44697->127.0.0.1:53: i/o timeout"
Fri Jun  7 09:15:51 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:51.106504 [error] dnsproxy: upstream 127.0.0.1:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001481132s: exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:44697->127.0.0.1:53: i/o timeout
Fri Jun  7 09:15:53 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:53.255717 [error] dnsproxy: [::1]:53: response received over udp: "exchanging with [::1]:53 over udp: read udp [::1]:33618->[::1]:53: i/o timeout"
Fri Jun  7 09:15:53 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:53.255815 [error] dnsproxy: upstream [::1]:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001736635s: exchanging with [::1]:53 over udp: read udp [::1]:33618->[::1]:53: i/o timeout
Fri Jun  7 09:15:53 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:53.256082 [error] dnsproxy: 127.0.0.1:53: response received over udp: "exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:49044->127.0.0.1:53: i/o timeout"
Fri Jun  7 09:15:53 2024 user.notice AdGuardHome[9325]: 2024/06/07 08:15:53.256130 [error] dnsproxy: upstream 127.0.0.1:53 failed to exchange ;150.6.168.192.in-addr.arpa.	IN	 SOA in 2.001394808s: exchanging with 127.0.0.1:53 over udp: read udp 127.0.0.1:49044->127.0.0.1:53: i/o timeout

A new version of the script was released!

Now the script uses pre-compressed binaries, which will save plenty of space.
From 31 MB → 6 MB on Flint2.

1 Like

Hi Admon, thank you for your work.
One question...for those who have already installed it, is the upgrade procedure the same as for a new installation?
Or does the script auto-update to the new version?

The script itself will auto-update - if the installed script version isn't older than 2024-04-13.
I would recommend to only use the script for updating AdGuard Home because this will allow you to benefit of the saved storage; the built-in updater of AGH will not take care of it.

2 Likes

Hey @admon, it seems your script contains hardcoded references to version 0.107.51. Your script successfully detects an older version is installed and v0.107.52 is available. It then proceeds to download your compressed v0.107.51 version and installs it, instead of the newer version.

The code can be found in the preflight_check function.

if [ "$ARCH" = "aarch64" ]; then
  log "SUCCESS" "Architecture: arm64"
  AGH_VERSION_DOWNLOAD="https://github.com/Admonstrator/glinet-adguard-updater/releases/download/v0.107.51/AdGuardHome-linux-arm64"
elif [ "$ARCH" = "armv7l" ]; then
  log "SUCCESS" "Architecture: armv7"
  AGH_VERSION_DOWNLOAD="https://github.com/Admonstrator/glinet-adguard-updater/releases/download/v0.107.51/AdGuardHome-linux-arm"
else
  log "ERROR" "This script only works on arm64 and armv7."
  PREFLIGHT=1
fi
3 Likes

Thanks for letting me know, this bug was fixed.

What do end users need to do to get this fix?

Re-run the script. Like always.

But it's not auto-update?

No, since the tiny binary must be installed manually or by script.
AGH can't update this binary itself.

Re-running the script will get the newest binary.

Do you mean re-run this below?

wget -O update-adguardhome.sh https://raw.githubusercontent.com/Admonstrator/glinet-adguard-updater/main/update-adguardhome.sh && sh update-adguardhome.sh

You can re-run it like this or just re-run the downloaded script, which will auto-update the script.

@admon can you add script about firewall for adguard when people upgraded frimware router?

Why should it be needed? The GL firmware provides the adjustments already.

Yes but problem is syntax which missing space. TCP/UDP

You need to explain a bit more so I can understand the issue.



Sorry, I mean TCP, UDP. With comma.

Seems to be a bug inside the GL firmware then?
Needs to get fixed by @alzhao