Просмотр исходного кода

os has become distroname

also added distroversion to identify the distro version number
Daniel Gibbs 9 лет назад
Родитель
Сommit
9168387277

+ 1 - 1
lgsm/functions/alert_email.sh

@@ -32,7 +32,7 @@ fn_details_os(){
 		echo -e ""
 		echo -e "Distro Details"
 		echo -e "================================="
-		echo -e "Distro: ${os}"
+		echo -e "Distro: ${distroname}"
 		echo -e "Arch: ${arch}"
 		echo -e "Kernel: ${kernel}"
 		echo -e "Hostname: $HOSTNAME"

+ 1 - 1
lgsm/functions/command_debug.sh

@@ -28,7 +28,7 @@ echo ""
 echo "${gamename} Debug"
 echo "================================="
 echo ""
-echo -e "Distro: ${os}"
+echo -e "Distro: ${distroname}"
 echo -e "Arch: ${arch}"
 echo -e "Kernel: ${kernel}"
 echo -e "Hostname: $HOSTNAME"

+ 1 - 1
lgsm/functions/command_details.sh

@@ -27,7 +27,7 @@ fn_details_os(){
 	echo -e "${lightyellow}Distro Details${default}"
 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	{
-		echo -e "${blue}Distro:\t${default}${os}"
+		echo -e "${blue}Distro:\t${default}${distroname}"
 		echo -e "${blue}Arch:\t${default}${arch}"
 		echo -e "${blue}Kernel:\t${default}${kernel}"
 		echo -e "${blue}Hostname:\t${default}$HOSTNAME"

+ 6 - 4
lgsm/functions/info_distro.sh

@@ -14,15 +14,17 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 arch=$(uname -m)
 kernel=$(uname -r)
 if [ -n "$(command -v lsb_release)" ]; then
-	os=$(lsb_release -s -d)
+	distroname=$(lsb_release -s -d)
 elif [ -f "/etc/debian_version" ]; then
-	os="Debian $(cat /etc/debian_version)"
+	distroname="Debian $(cat /etc/debian_version)"
 elif [ -f "/etc/redhat-release" ]; then
-	os=$(cat /etc/redhat-release)
+	distroname=$(cat /etc/redhat-release)
 else
-	os="$(uname -s) $(uname -r)"
+	distroname="$(uname -s) $(uname -r)"
 fi
 
+distroversion=$(grep VERSION_ID /etc/os-release |tr -cd '[:digit:]')
+
 ## Glibc version
 # e.g: 1.17
 glibcversion="$(ldd --version | sed -n '1s/.* //p')"