Skip to content

Commit

Permalink
fix: distro.sh: line 100: [: : integer expression expected (#4486)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
BertBrenner and dgibbs64 committed Feb 21, 2024
1 parent e281f5a commit 1528cba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lgsm/modules/info_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1528cba

Please sign in to comment.