Skip to content

Commit 1528cba

Browse files
BertBrennerdgibbs64
andcommitted
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>
1 parent e281f5a commit 1528cba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lgsm/modules/info_distro.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ for distro_info in "${distro_info_array[@]}"; do
3030
if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then
3131
distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. Ubuntu 22.04.3 LTS
3232
distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. 22.04
33+
distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. ubuntu
34+
distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian
35+
distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. jammy
3336
# Special var for rhel like distros to remove point in number e.g 8.4 to just 8.
3437
if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then
3538
distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" # e.g. 8
3639
fi
37-
distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. ubuntu
38-
distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian
39-
distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. jammy
4040
elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then
4141
if [ -z "${distroname}" ]; then
4242
distroname="$(lsb_release -sd)" # e.g. Ubuntu 22.04.3 LTS

0 commit comments

Comments
 (0)