diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh index 2fdb0ff8f2..81d34ff849 100755 --- a/.github/workflows/serverlist-validate-game-icons.sh +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -16,7 +16,7 @@ done echo "" echo "Checking if an unexpected gameicon exists" -for gameicon in $(ls -1 gameicons); do +for gameicon in gameicons/*; do # check if $gameicon is in serverlist.csv if ! grep -q "${gameicon%-icon.png}" serverlist.csv; then echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" @@ -37,4 +37,4 @@ else echo "OK: gameiconcount ($gameiconcount) matches serverlistcount ($serverlistcount)" fi -exit ${exitcode} +exit "${exitcode}" diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh index 7d931372d8..fb8dd400d8 100755 --- a/.github/workflows/serverlist-validate.sh +++ b/.github/workflows/serverlist-validate.sh @@ -35,4 +35,4 @@ for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do fi done -exit ${exitcode} +exit "${exitcode}" diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 348e49b6c3..95d4a6ad08 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -235,7 +235,7 @@ fn_install_missing_deps() { fn_check_loop() { # Loop though required depenencies checking if they are installed. - for deptocheck in ${array_deps_required[*]}; do + for deptocheck in "${array_deps_required[@]}"; do fn_deps_detector done @@ -319,7 +319,7 @@ fn_deps_detector() { fi # If SteamCMD requirements are not met install will fail. if [ -n "${appid}" ]; then - for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do + for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then steamcmdfail=1 fi diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index f427e8b008..010c605777 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -190,7 +190,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g") if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +198,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g") if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index 9a4dcc4265..3299be5094 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -29,7 +29,7 @@ fn_script_log_info "Selecting repo" curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null exitcode=$? if [ "${exitcode}" -ne "0" ]; then - curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null exitcode=$? if [ "${exitcode}" -ne "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh index 7839be6a99..b88e0c05eb 100644 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -618,7 +618,7 @@ fn_mod_install_liblist_gam_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -642,7 +642,7 @@ fn_mod_remove_liblist_gam_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -658,7 +658,7 @@ fn_mod_remove_liblist_gam_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -676,7 +676,7 @@ fn_mod_remove_liblist_gam_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -699,7 +699,7 @@ fn_mod_install_amxmodx_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -712,7 +712,7 @@ fn_mod_install_amxmodx_file() { fn_print_fail_eol_nl core_exit.sh else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -736,7 +736,7 @@ fn_mod_remove_amxmodx_file() { fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi