From 9955f1fc024bcd5fb3ef76ee39af53ea16935cd7 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 24 Oct 2020 13:16:56 +0200 Subject: [PATCH] Updated WireGuard module detection to accommodate different paths --- auto_install/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index e37ef3e..1e2d083 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -77,6 +77,9 @@ c=$(( c < 70 ? 70 : c )) # Override localization settings so the output is in English language. export LC_ALL=C +# Enable recursive globbing to find wireguard.ko in /lib/modules. +shopt -s globstar + main(){ ######## FIRST CHECK ######## @@ -488,7 +491,7 @@ preconfigurePackages(){ # make the module part of the package since the module itself is built at install time # and not part of the .deb). # Source: https://github.com/MichaIng/DietPi/blob/7bf5e1041f3b2972d7827c48215069d1c90eee07/dietpi/dietpi-software#L1807-L1815 - for i in /lib/modules/*/kernel/net/wireguard/wireguard.ko; do + for i in /lib/modules/**/wireguard.ko; do [[ -f $i ]] || continue dpkg-query -S "$i" &> /dev/null || continue WIREGUARD_BUILTIN=1