Explorar o código

fix: distro.sh: line 100: [: : integer expression expected (#4486)

* fix: servername variable assignment for sf and unt

The servername variable was incorrectly assigned using the selfname variable instead of the correct servername variable. This has been fixed to ensure accurate information is displayed for each game type.

* [FIX] #4465

---------

Co-authored-by: Daniel Gibbs <me@danielgibbs.co.uk>
BertBrenner %!s(int64=2) %!d(string=hai) anos
pai
achega
1528cba08d
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      lgsm/modules/info_distro.sh

+ 3 - 3
lgsm/modules/info_distro.sh

@@ -30,13 +30,13 @@ for distro_info in "${distro_info_array[@]}"; do
 	if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then
 		distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')"   # e.g. Ubuntu 22.04.3 LTS
 		distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. 22.04
+		distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')"          # e.g. ubuntu
+		distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian
+		distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')"     # e.g. jammy
 		# Special var for rhel like distros to remove point in number e.g 8.4 to just 8.
 		if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then
 			distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" # e.g. 8
 		fi
-		distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')"          # e.g. ubuntu
-		distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian
-		distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')"     # e.g. jammy
 	elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then
 		if [ -z "${distroname}" ]; then
 			distroname="$(lsb_release -sd)" # e.g. Ubuntu 22.04.3 LTS