From 2f849f78950b00cfd5f963ab9d391c402c34c17d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 12 Sep 2021 21:27:11 +0100 Subject: [PATCH] uniq sort dependency array --- lgsm/functions/check_deps.sh | 4 ++++ lgsm/functions/info_distro.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 8d128fedd..2f0b2d169 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -340,7 +340,11 @@ if [ -f "${datadir}/${distroid}-${distroversion}.csv" ]; then # Generate array of missing deps. array_deps_missing=() + array_deps_required=("${dependencyall} ${dependencysteamcmd} ${dependencyshortname}") + # Unique sort dependency array. + IFS=" " read -r -a array_deps_required <<< "$(echo "${array_deps_required[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')" + fn_deps_email fn_check_loop # Warn the user that dependency checking is unavailable for their distro. diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 08c0e5e75..9ec25d8f9 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -275,7 +275,7 @@ if [ "${masterserverbypass}" == "1" ]; then masterserverbypass=1 if [ "$(command -v jq 2>/dev/null)" ]; then if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]||[ ${commandname} == "DEV-QUERY-RAW" ]; then + if [ "${steammaster}" == "true" ]||[ "${commandname}" == "DEV-QUERY-RAW" ]; then # Will query server IP addresses first. for queryip in "${queryips[@]}"; do masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)"