Daniel Gibbs 2 лет назад
Родитель
Сommit
4faf380423

+ 4 - 4
lgsm/modules/check_deps.sh

@@ -336,15 +336,15 @@ fn_deps_detector() {
 if [ "${commandname}" == "INSTALL" ]; then
 	if [ "$(whoami)" == "root" ]; then
 		echo -e ""
-		echo -e "${lightyellow}Checking Dependencies as root${default}"
-		echo -e "================================="
+		echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}"
+		echo -e "${bold}=================================${default}"
 		fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
 		fn_print_information_nl "This will NOT install a ${gamename} server."
 		fn_sleep_time
 	else
 		echo -e ""
-		echo -e "${lightyellow}Checking Dependencies${default}"
-		echo -e "================================="
+		echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}"
+		echo -e "${bold}=================================${default}"
 	fi
 fi
 

+ 5 - 5
lgsm/modules/core_dl.sh

@@ -150,16 +150,16 @@ fn_dl_steamcmd() {
 
 # Emptys contents of the LinuxGSM tmpdir.
 fn_clear_tmp() {
-	echo -en "clearing LinuxGSM tmp directory..."
+	echo -en "clearing tmp directory [ ${tmpdir} ]"
 	if [ -d "${tmpdir}" ]; then
 		rm -rf "${tmpdir:?}/"*
 		local exitcode=$?
 		if [ "${exitcode}" != 0 ]; then
 			fn_print_error_eol_nl
-			fn_script_log_error "clearing LinuxGSM tmp directory"
+			fn_script_log_error "clearing tmp directory ${tmpdir}"
 		else
 			fn_print_ok_eol_nl
-			fn_script_log_pass "clearing LinuxGSM tmp directory"
+			fn_script_log_pass "clearing tmp directory ${tmpdir}"
 		fi
 	fi
 }
@@ -397,11 +397,11 @@ fn_fetch_file() {
 			local exitcode=""
 			large_files=("bz2" "gz" "zip" "jar" "xz")
 			if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then
-				echo -en "downloading ${local_filename}..."
+				echo -e "downloading file [ ${local_filename} ]"
 				fn_sleep_time
-				echo -en "\033[1K"
 				"${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1
 				exitcode="$?"
+				echo -en "downloading file [ ${local_filename} ]"
 			else
 				echo -en "fetching ${fileurl_name} [ ${italic}${local_filename}${default} ]\c"
 				"${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1

+ 20 - 4
lgsm/modules/install_config.sh

@@ -21,7 +21,10 @@ fn_fetch_default_config() {
 	echo -e ""
 	echo -e "${lightyellow}Downloading ${gamename} Configs${default}"
 	echo -e "================================="
-	echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs"
+	echo -e "Default configs are downloaded from:"
+	echo -e ""
+	echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
+	echo -e ""
 	fn_sleep_time
 	mkdir -p "${lgsmdir}/config-default/config-game"
 	githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
@@ -31,22 +34,35 @@ fn_fetch_default_config() {
 }
 
 # Copys default configs from Game-Server-Configs repo to server config location.
+# TODO: no error checking in place currently
 fn_default_config_remote() {
 	for config in "${array_configs[@]}"; do
 		# every config is copied
-		echo -e "copying ${config} config file."
-		fn_script_log_info "copying ${servercfg} config file."
+		echo -en "copying config file [ ${config} ]"
+		fn_script_log_info
 		if [ "${config}" == "${servercfgdefault}" ]; then
 			mkdir -p "${servercfgdir}"
 			cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}"
+			exitcode=$?
 		elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then
 			mkdir -p "${servercfgdir}"
 			cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}"
+			exitcode=$?
 		elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then
+			mkdir -p "${clustercfgfullpath}"
 			cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}"
+			exitcode=$?
 		else
 			mkdir -p "${servercfgdir}"
 			cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}"
+			exitcode=$?
+		fi
+		if [ "${exitcode}" != 0 ]; then
+			fn_print_failure_nl
+			fn_script_log_fatal "copying config file ${servercfg}."
+		else
+			fn_print_ok_nl
+			fn_script_log_pass "copying config file ${servercfg}."
 		fi
 	done
 	fn_sleep_time
@@ -64,7 +80,7 @@ fn_default_config_local() {
 # PASSWORD to random password
 fn_set_config_vars() {
 	if [ -f "${servercfgfullpath}" ]; then
-		random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs)
+		random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
 		servername="LinuxGSM"
 		rconpass="admin${random}"
 		echo -e "changing hostname."

+ 0 - 1
lgsm/modules/install_eula.sh

@@ -25,7 +25,6 @@ echo -e "${italic}${eulaurl}${default}"
 echo -e ""
 if [ -z "${autoinstall}" ]; then
 	echo -e "By continuing you are indicating your agreement to the EULA."
-	echo -e ""
 	if ! fn_prompt_yn "Continue?" Y; then
 		exitcode=0
 		core_exit.sh