Browse Source

fix(deps): fetch distro dependency csv when run as root before install (#5132)

fn_check_file only set checkflag when the script log already existed. Running install or auto-install as root before the game user had installed left checkflag empty, so check_deps.sh skipped fetching the distro dependency CSV and reported dependency checking as unavailable.

Set checkflag regardless of the log state; only the log writes remain guarded.

Fixes #3774
Daniel Gibbs 2 days ago
parent
commit
70818f4639
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lgsm/modules/core_dl.sh

+ 3 - 3
lgsm/modules/core_dl.sh

@@ -412,17 +412,17 @@ fn_check_file() {
 		if [ "${exitcode}" -ne 0 ]; then
 			if [ ${counter} -ge 2 ]; then
 				fn_print_fail_eol_nl
+				checkflag=1
 				if [ -f "${lgsmlog}" ]; then
 					fn_script_log_fail "Checking ${remote_filename}"
 					fn_script_log_fail "${fileurl}"
-					checkflag=1
 				fi
 			else
 				fn_print_error_eol_nl
+				checkflag=2
 				if [ -f "${lgsmlog}" ]; then
 					fn_script_log_error "Checking ${remote_filename}"
 					fn_script_log_error "${fileurl}"
-					checkflag=2
 				fi
 			fi
 		else
@@ -432,9 +432,9 @@ fn_check_file() {
 				fn_print_ok_eol
 				echo -en "\033[2K\\r"
 			fi
+			checkflag=0
 			if [ -f "${lgsmlog}" ]; then
 				fn_script_log_pass "Checking ${remote_filename}"
-				checkflag=0
 			fi
 			break
 		fi