From 33d8e8e00b94312e303dabb490d1165702380d8c Mon Sep 17 00:00:00 2001 From: Steve Kolenich Date: Thu, 6 Aug 2020 20:15:18 -0400 Subject: [PATCH] Adding Alpine Linux to OSDetection --- include/osdetection | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/osdetection b/include/osdetection index 783662ad..c2726d31 100644 --- a/include/osdetection +++ b/include/osdetection @@ -144,6 +144,12 @@ OS_ID=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') if [ -n "${OS_ID}" ]; then case ${OS_ID} in + "alpine") + LINUX_VERSION="Alpine Linux" + OS_NAME=$(grep "^PRETTY_NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_VERSION_FULL=$(grep "^VERSION=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + ;; "amzn") LINUX_VERSION="Amazon Linux" OS_NAME="Amazon Linux" @@ -268,6 +274,9 @@ fi fi + # Alpine + if [ -e "/etc/alpine-release" ]; then LINUX_VERSION="Alpine Linux"; OS_VERSION=$(cat /etc/alpine-release); fi + # Amazon if [ -z "${LINUX_VERSION}" -a -e "/etc/system-release" ]; then FIND=$(grep "^Amazon" /etc/system-release)