From 7d427b23eed1a6467e7a4319bad322f1e76c9990 Mon Sep 17 00:00:00 2001
From: Charlie Powell <cdp1337@veraciousnetwork.com>
Date: Thu, 12 Oct 2023 21:44:07 -0400
Subject: [PATCH] Fix for Raspbian detection

---
 CHANGELOG                |  3 +++
 VERSION                  |  2 +-
 builds/bin/basescript.sh | 16 +++++++++++++---
 src/basescript.sh        |  9 ++++++++-
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 857a9fc..c9b99ef 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+2023.10.12
+ * Fix for Raspbian detection
+
 2023.09.06
  * Some fixes for BSD
 
diff --git a/VERSION b/VERSION
index 4267af9..c2d652e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2023.09.06
\ No newline at end of file
+2023.10.12
\ No newline at end of file
diff --git a/builds/bin/basescript.sh b/builds/bin/basescript.sh
index fd94d63..787b235 100644
--- a/builds/bin/basescript.sh
+++ b/builds/bin/basescript.sh
@@ -3,12 +3,12 @@
 # Base Script
 #
 # @author Charlie Powell <charlie@evalagency.com>
-# @version 2023.09.02
+# @version 2023.10.12
 #
 # @license All Rights Reserved - Closed source, it's not licensed yet!
 #          Why?  Because I haven't gone back through recently and cleaned it up :p
 #
-BASESCRIPT_VERSION="2023.09.02"
+BASESCRIPT_VERSION="2023.10.12"
 #@############################################################################@#
 # Variables defined herein
 #@----------------------------------------------------------------------------@#
@@ -20,6 +20,9 @@ BASESCRIPT_VERSION="2023.09.02"
 #                    Set to "0" by default if not set otherwise.
 #@############################################################################@#
 # @changelog
+# 2023.10.12
+# * Fix for Raspbian detection
+# 
 # 2023.09.06
 # * Some fixes for BSD
 # 
@@ -351,7 +354,14 @@ elif [ -f "/etc/debian_version" -a -f "/etc/lsb-release" -a -n "$(grep 'DISTRIB_
 
 	# Check for debian_version
 elif [ -f "/etc/debian_version" ]; then
-	OS='debian'
+
+  if [ -f "/etc/os-release" ]; then
+    # OS-Release houses more specific information, (ie: Raspbian)
+    OS="$(grep -e '^ID=' /etc/os-release | sed 's:.*=\(.*\):\1:')"
+  else
+	  OS='debian'
+  fi
+
 	OSFAMILY="debian"
 
 	if [ -n "$(grep buster /etc/debian_version)" ]; then
diff --git a/src/basescript.sh b/src/basescript.sh
index 2fdff2e..0beb9c8 100644
--- a/src/basescript.sh
+++ b/src/basescript.sh
@@ -229,7 +229,14 @@ elif [ -f "/etc/debian_version" -a -f "/etc/lsb-release" -a -n "$(grep 'DISTRIB_
 
 	# Check for debian_version
 elif [ -f "/etc/debian_version" ]; then
-	OS='debian'
+
+  if [ -f "/etc/os-release" ]; then
+    # OS-Release houses more specific information, (ie: Raspbian)
+    OS="$(grep -e '^ID=' /etc/os-release | sed 's:.*=\(.*\):\1:')"
+  else
+	  OS='debian'
+  fi
+
 	OSFAMILY="debian"
 
 	if [ -n "$(grep buster /etc/debian_version)" ]; then
-- 
GitLab