From 52a2f166fd44ea3e40604f71d8ea6c984863eb31 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 13 Feb 2017 10:29:27 +0100 Subject: [PATCH] Add FTLdownload() subroutine --- automated install/basic-install.sh | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index c70dd393..5ce4898d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1150,6 +1150,38 @@ if [[ "${reconfigure}" == true ]]; then fi } +FTLdownload() { + + local machine=$(uname -m) + + echo $machine + + if [[ $machine == arm* ]]; then + # ARM + if [ -f "/lib/ld-linux-aarch64.so.1" ]; then + echo "Detected ARM-aarch64 architecture" + binary="pihole-FTL-aarch64-linux-gnu" + elif [ -f "/lib/ld-linux-armhf.so.3" ]; then + echo "Detected ARM-hf architecture" + binary="pihole-FTL-arm-linux-gnueabihf" + else + echo "Detected ARM architecture" + binary="pihole-FTL-arm-linux-gnueabi" + fi + elif [[ $machine == x86_64 ]]; then + # 64bit + echo "Detected x86_64 architecture" + binary="pihole-FTL-linux-x86_64" + else + # Something else - we try to use 32bit executable and warn the user + echo "Not able to detect architecture" + binary="pihole-FTL-linux-x86_32" + fi + + curl -sSL "https://github.com/pi-hole/FTL/releases/latest/${binary}" -o "/etc/pihole/pihole-FTL" +} + + main() { ######## FIRST CHECK ########