From 2f7e346767a1996aa89a33c24d845881947842d6 Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Sun, 22 Jan 2023 12:11:19 +0100 Subject: [PATCH] Fix Ubuntu detection --- wireguard-install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wireguard-install.sh b/wireguard-install.sh index 1be20cd..97cf3f1 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -39,6 +39,12 @@ function checkOS() { exit 1 fi OS=debian # overwrite if raspbian + elif [[ ${OS} == "ubuntu" ]]; then + RELEASE_YEAR=$(echo "${VERSION_ID}" | cut -d'.' -f1) + if [[ ${RELEASE_YEAR} -lt 18 ]]; then + echo "Your version of Ubuntu (${VERSION_ID}) is not supported. Please use Ubuntu 18.04 or later" + exit 1 + fi elif [[ ${OS} == "fedora" ]]; then if [[ ${VERSION_ID} -lt 32 ]]; then echo "Your version of Fedora (${VERSION_ID}) is not supported. Please use Fedora 32 or later"