Daniel Gibbs 6 лет назад
Родитель
Сommit
3ae32af099

+ 8 - 8
lgsm/functions/alert.sh

@@ -118,7 +118,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
 	fn_script_log_warn "Discord alerts not enabled"
 elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Discord token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/discord"
+	echo -e "* https://docs.linuxgsm.com/alerts/discord"
 	fn_script_error "Discord token not set"
 fi
 
@@ -139,7 +139,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
 	fn_script_log_warn "IFTTT alerts not enabled"
 elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "IFTTT token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/ifttt"
+	echo -e "* https://docs.linuxgsm.com/alerts/ifttt"
 	fn_script_error "IFTTT token not set"
 fi
 
@@ -150,7 +150,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
 	fn_script_log_warn "Mailgun alerts not enabled"
 elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Mailgun token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/mailgun"
+	echo -e "* https://docs.linuxgsm.com/alerts/mailgun"
 	fn_script_error "Mailgun token not set"
 fi
 
@@ -161,7 +161,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test
 	fn_script_log_warn "Pushbullet alerts not enabled"
 elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Pushbullet token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/pushbullet"
+	echo -e "* https://docs.linuxgsm.com/alerts/pushbullet"
 	fn_script_error "Pushbullet token not set"
 fi
 
@@ -172,7 +172,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
 	fn_script_log_warn "Pushover alerts not enabled"
 elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Pushover token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/pushover"
+	echo -e "* https://docs.linuxgsm.com/alerts/pushover"
 	fn_script_error "Pushover token not set"
 fi
 
@@ -183,11 +183,11 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
 	fn_script_log_warn "Telegram Messages not enabled"
 elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Telegram token not set."
-	echo -e "	* https://docs.linuxgsm.com/alerts/telegram"
+	echo -e "* https://docs.linuxgsm.com/alerts/telegram"
 	fn_script_error "Telegram token not set."
 elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Telegram chat id not set."
-	echo -e "	* https://docs.linuxgsm.com/alerts/telegram"
+	echo -e "* https://docs.linuxgsm.com/alerts/telegram"
 	fn_script_error "Telegram chat id not set."
 fi
 
@@ -198,6 +198,6 @@ elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
 	fn_script_log_warn "Slack alerts not enabled"
 elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error "Slack token not set"
-	echo -e "	* https://docs.linuxgsm.com/alerts/slack"
+	echo -e "* https://docs.linuxgsm.com/alerts/slack"
 	fn_script_error "Slack token not set"
 fi

+ 2 - 2
lgsm/functions/alert_discord.sh

@@ -58,9 +58,9 @@ fn_print_dots "Sending Discord alert"
 discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}")
 
 if [ "${discordsend}" ]; then
-	fn_print_fail_nl "Sending Discord alert: ${discordsend}"
+	fn_print_fail "Sending Discord alert: ${discordsend}"
 	fn_script_log_fatal "Sending Discord alert: ${discordsend}"
 else
-	fn_print_ok_nl "Sending Discord alert"
+	fn_print_ok "Sending Discord alert"
 	fn_script_log_pass "Sending Discord alert"
 fi

+ 2 - 2
lgsm/functions/alert_email.sh

@@ -18,9 +18,9 @@ else
 fi
 exitcode=$?
 if [ "${exitcode}" == "0" ]; then
-	fn_print_ok_nl "Sending Email alert: ${email}"
+	fn_print_ok "Sending Email alert: ${email}"
 	fn_script_log_pass "Sending Email alert: ${email}"
 else
-	fn_print_fail_nl "Sending Email alert: ${email}"
+	fn_print_fail "Sending Email alert: ${email}"
 	fn_script_log_fatal "Sending Email alert: ${email}"
 fi

+ 2 - 2
lgsm/functions/alert_ifttt.sh

@@ -21,9 +21,9 @@ fn_print_dots "Sending IFTTT alert"
 iftttsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request")
 
 if [ "${iftttsend}" ]; then
-	fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}"
+	fn_print_fail "Sending IFTTT alert: ${pushbulletsend}"
 	fn_script_log_fatal "Sending IFTTT alert: ${pushbulletsend}"
 else
-	fn_print_ok_nl "Sending IFTTT alert"
+	fn_print_ok "Sending IFTTT alert"
 	fn_script_log_pass "Sent IFTTT alert"
 fi

+ 2 - 2
lgsm/functions/alert_mailgun.sh

@@ -19,9 +19,9 @@ mailgunsend=$(curl -s --user "api:${mailguntoken}" \
 -F text="$(cat "${alertlog}")" "https://api.mailgun.net/v3/${mailgundomain}/messages")
 
 if [ -z "${mailgunsend}" ]; then
-	fn_print_fail_nl "Sending Email alert: Mailgun: ${email}"
+	fn_print_fail "Sending Email alert: Mailgun: ${email}"
 	fn_script_log_fatal "Sending Email alert: Mailgun: ${email}"
 else
-	fn_print_ok_nl "Sending Email alert: Mailgun: ${email}"
+	fn_print_ok "Sending Email alert: Mailgun: ${email}"
 	fn_script_log_pass "Sending Email alert: Mailgun: ${email}"
 fi

+ 2 - 2
lgsm/functions/alert_pushbullet.sh

@@ -22,9 +22,9 @@ fn_print_dots "Sending Pushbullet alert"
 pushbulletsend=$(curl -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.pushbullet.com/v2/pushes" | grep "error_code")
 
 if [ "${pushbulletsend}" ]; then
-	fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}"
+	fn_print_fail "Sending Pushbullet alert: ${pushbulletsend}"
 	fn_script_log_fatal "Sending Pushbullet alert: ${pushbulletsend}"
 else
-	fn_print_ok_nl "Sending Pushbullet alert"
+	fn_print_ok "Sending Pushbullet alert"
 	fn_script_log_pass "Sent Pushbullet alert"
 fi

+ 2 - 2
lgsm/functions/alert_pushover.sh

@@ -26,9 +26,9 @@ fi
 pushoversend=$(curl -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}"  -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" <b>Message</b><br>${alertbody}<br><br><b>Game</b><br>${gamename}<br><br><b>Server name</b><br>${servername}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${alertip}:${port}'>${alertip}:${port}</a><br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
 
 if [ "${pushoversend}" ]; then
-	fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"
+	fn_print_fail "Sending Pushover alert: ${pushoversend}"
 	fn_script_log_fatal "Sending Pushover alert: ${pushoversend}"
 else
-	fn_print_ok_nl "Sending Pushover alert"
+	fn_print_ok "Sending Pushover alert"
 	fn_script_log_pass "Sent Pushover alert"
 fi

+ 2 - 2
lgsm/functions/alert_slack.sh

@@ -72,9 +72,9 @@ fn_print_dots "Sending Slack alert"
 slacksend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${slackwebhook}")
 
 if [ "${slacksend}" == "ok" ]; then
-	fn_print_ok_nl "Sending Slack alert"
+	fn_print_ok "Sending Slack alert"
 	fn_script_log_pass "Sending Slack alert"
 else
-    fn_print_fail_nl "Sending Slack alert: ${slacksend}"
+    fn_print_fail "Sending Slack alert: ${slacksend}"
 	fn_script_log_fatal "Sending Slack alert: ${slacksend}"
 fi

+ 2 - 2
lgsm/functions/alert_telegram.sh

@@ -21,9 +21,9 @@ fn_print_dots "Sending Telegram alert"
 telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" "${curlcustomstring}" | grep "error_code")
 
 if [ "${telegramsend}" ]; then
-	fn_print_fail_nl "Sending Telegram alert: ${telegramsend}"
+	fn_print_fail "Sending Telegram alert: ${telegramsend}"
 	fn_script_log_fatal "Sending Telegram alert: ${telegramsend}"
 else
-	fn_print_ok_nl "Sending Telegram alert"
+	fn_print_ok "Sending Telegram alert"
 	fn_script_log_pass "Sent Telegram alert"
 fi

+ 1 - 1
lgsm/functions/check_ip.sh

@@ -80,7 +80,7 @@ if [ "${travistest}" != "1" ]; then
 			    core_exit.sh
 			fi
 		else
-			fn_print_info_nl "Check IP: ${getip}"
+			fn_print_info "Check IP: ${getip}"
 			fn_script_log_info "IP automatically set as: ${getip}"
 			ip="${getip}"
 		fi

+ 28 - 3
lgsm/functions/check_steamcmd.sh

@@ -7,6 +7,9 @@
 local modulename="CHECK"
 
 fn_install_steamcmd(){
+	if [ ${shortname} == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then
+		steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
+	fi
 	if [ ! -d "${steamcmddir}" ]; then
 		mkdir -pv "${steamcmddir}"
 	fi
@@ -50,8 +53,8 @@ fn_check_steamcmd(){
 		if [ "${function_selfname}" == "command_install.sh" ]; then
 			fn_install_steamcmd
 		else
-			fn_print_error_nl "SteamCMD is missing"
-			fn_script_log_error "SteamCMD is missing"
+			fn_print_warn_nl "SteamCMD is missing"
+			fn_script_log_warn "SteamCMD is missing"
 			fn_install_steamcmd
 		fi
 	elif [ "${function_selfname}" == "command_install.sh" ]; then
@@ -60,6 +63,25 @@ fn_check_steamcmd(){
 	fi
 }
 
+fn_check_steamcmd_ark(){
+	# Checks if SteamCMD exists in
+	# Engine/Binaries/ThirdParty/SteamCMD/Linux
+	# to allow ark mods to work
+	if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
+		installsteamcmd=1
+		if [ "${function_selfname}" == "command_install.sh" ]; then
+			fn_install_steamcmd
+		else
+			fn_print_warn_nl "ARK mods SteamCMD is missing"
+			fn_script_log_warn "ARK mods SteamCMD is missing"
+			fn_install_steamcmd
+		fi
+	elif [ "${function_selfname}" == "command_install.sh" ]; then
+		fn_print_information "ARK mods SteamCMD is already installed..."
+		fn_print_ok_eol_nl
+	fi
+}
+
 fn_check_steamcmd_clear(){
 # Will remove steamcmd dir if steamcmd package is installed.
 if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${steamcmddir}" ]; then
@@ -81,7 +103,10 @@ fn_check_steamcmd_exec(){
 	fi
 }
 
-fn_check_steamcmd
 fn_check_steamcmd_clear
+fn_check_steamcmd
+if [ ${shortname} == "ark" ]; then
+	fn_check_steamcmd_ark
+fi
 fn_check_steamcmd_user
 fn_check_steamcmd_exec

+ 12 - 11
lgsm/functions/command_backup.sh

@@ -54,7 +54,8 @@ fn_backup_init(){
 		else
 			daysago="${lastbackupdaysago} days ago"
 		fi
-		echo -e "	* Previous backup was created ${daysago}, total size ${lastbackupsize}"
+		echo -en "\n"
+		echo -e "* Previous backup was created ${daysago}, total size ${lastbackupsize}"
 	fi
 }
 
@@ -68,12 +69,12 @@ fn_backup_stop_server(){
 	elif [ "${stoponbackup}" == "off" ]; then
 		serverstopped="no"
 		fn_print_warn_nl "${selfname} is currently running"
-		echo -e "	* Although unlikely; creating a backup while ${selfname} is running might corrupt the backup."
+		echo -e "* Although unlikely; creating a backup while ${selfname} is running might corrupt the backup."
 		fn_script_log_warn "${selfname} is currently running"
 		fn_script_log_warn "Although unlikely; creating a backup while ${selfname} is running might corrupt the backup"
 	# Server is running and will be stopped if stoponbackup=on or unset.
 	else
-		fn_print_warn_nl "${selfname} will be stopped during the backup"
+		fn_print_warn "${selfname} will be stopped during the backup"
 		fn_script_log_warn "${selfname} will be stopped during the backup"
 		serverstopped="yes"
 		exitbypass=1
@@ -134,7 +135,7 @@ fn_backup_compression(){
 
 	# Check that excludedir is a valid path.
 	if [ ! -d "${excludedir}" ] ; then
-		fn_print_fail_nl "Problem identifying the previous backup directory for exclusion."
+		fn_print_fail "Problem identifying the previous backup directory for exclusion."
 		fn_script_log_fatal "Problem identifying the previous backup directory for exclusion"
 		core_exit.sh
 	fi
@@ -145,11 +146,11 @@ fn_backup_compression(){
 		fn_print_fail_eol
 		fn_script_log_fatal "Backup in progress: FAIL"
 		echo -e "${tarcmd}" | tee -a "${lgsmlog}"
-		fn_print_fail_nl "Starting backup"
+		fn_print_fail "Starting backup"
 		fn_script_log_fatal "Starting backup"
 	else
 		fn_print_ok_eol
-		fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
+		fn_print_ok "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
 		fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
 	fi
 	# Remove lock file
@@ -170,30 +171,30 @@ fn_backup_prune(){
 		if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then
 			fn_print_dots "Pruning"
 			fn_script_log_info "Backup pruning activated"
-			fn_print_ok_nl "Pruning"
+			fn_print_ok "Pruning"
 			# If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays.
 			if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then
 				# Display how many backups will be cleared.
-				echo -e "	* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit"
+				echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit"
 				fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit"
 				fn_sleep_time
 				fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)"
 				fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)"
 				# Clear backups over quota.
 				find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm
-				fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)"
+				fn_print_ok "Pruning: Clearing ${backupquotadiff} backup(s)"
 				fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)"
 			# If maxbackupdays is used over maxbackups.
 			elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then
 				# Display how many backups will be cleared.
-				echo -e "	* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days."
+				echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days."
 				fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days."
 				fn_sleep_time
 				fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)."
 				fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)"
 				# Clear backups over quota
 				find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \;
-				fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)"
+				fn_print_ok "Pruning: Clearing ${backupquotadiff} backup(s)"
 				fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)"
 			fi
 		fi

+ 1 - 1
lgsm/functions/command_donate.sh

@@ -16,8 +16,8 @@ echo -e "Been using LinuxGSM?"
 echo -e "Consider donating to support development."
 echo -e ""
 echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon"
+echo -e "* ${lightblue}GitHub:${default} https://github.com/sponsors/dgibbs64"
 echo -e "* ${lightblue}PayPal:${default} https://linuxgsm.com/paypal"
-echo -e "* ${lightblue}Ko-Fi:${default} https://linuxgsm.com/ko-fi"
 echo -e ""
 echo -e "LinuxGSM est. 2012"
 

+ 1 - 1
lgsm/functions/command_start.sh

@@ -170,7 +170,7 @@ fn_print_dots "${servername}"
 # Is the server already started.
 # $status comes from check_status.sh, which is run by check.sh for this command
 if [ "${status}" != "0" ]; then
-	fn_print_info_nl "${servername} is already running"
+	fn_print_info "${servername} is already running"
 	fn_script_log_error "${servername} is already running"
 	if [ -z "${exitbypass}" ]; then
 		core_exit.sh

+ 1 - 1
lgsm/functions/command_stop.sh

@@ -211,7 +211,7 @@ fn_stop_tmux(){
 	fn_sleep_time
 	check_status.sh
 	if [ "${status}" == "0" ]; then
-		fn_print_ok_nl "${servername}"
+		fn_print_ok "${servername}"
 		fn_script_log_pass "Stopped ${servername}"
 	else
 		fn_print_fail_nl "Unable to stop ${servername}"

+ 0 - 1
lgsm/functions/command_test_alert.sh

@@ -13,5 +13,4 @@ check.sh
 info_config.sh
 alert="test"
 alert.sh
-
 core_exit.sh

+ 2 - 2
lgsm/functions/command_validate.sh

@@ -30,10 +30,10 @@ fn_validation(){
 		${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}"
 	fi
 	if [ $? != 0 ]; then
-		fn_print_fail_nl "Validating files: SteamCMD"
+		fn_print_fail "Validating files: SteamCMD"
 		fn_script_log_fatal "Validating files: SteamCMD: FAIL"
 	else
-		fn_print_ok_nl "Validating files: SteamCMD"
+		fn_print_ok "Validating files: SteamCMD"
 		fn_script_log_pass "Validating files: SteamCMD: OK"
 	fi
 	fix.sh

+ 1 - 1
lgsm/functions/fix.sh

@@ -17,7 +17,7 @@ fn_fix_msg_start(){
 
 fn_fix_msg_start_nl(){
 	fn_print_dots "Applying ${fixname} fix: ${gamename}"
-	fn_print_info "Applying ${fixname} fix: ${gamename}"
+	fn_print_info_nl "Applying ${fixname} fix: ${gamename}"
 	fn_script_log_info "Applying ${fixname} fix: ${gamename}"
 }
 

+ 19 - 15
lgsm/functions/fix_ark.sh

@@ -4,33 +4,37 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with ARK: Survival Evolved.
 
-# removes the symlink if broken. fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd
-# rather than ${HOME}/.steam. This fix could be deprecated eventually.
-if [ ! -e "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
-	fixname="broken steamcmd symlink"
+# removes the symlink if exists.
+# fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd
+if [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
+	fixname="broken SteamCMD symlink"
 	fn_fix_msg_start
-	rm -f "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
+	unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
 	fn_fix_msg_end
+	check_steamcmd.sh
 fi
 
-if [ ! -e "${HOME}/.steam/steamcmd/steamapps" ]; then
-	fixname="broken steamcmd symlink"
+# removed ARK steamcmd directory if steamcmd is missing.
+if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
+	fixname="remove invalid ARK SteamCMD directory"
 	fn_fix_msg_start
-	rm -f "${HOME}/.steam/steamcmd/steamapps"
+	rm -rf "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
 	fn_fix_msg_end
+	check_steamcmd.sh
 fi
 
-# Symlinking the SteamCMD directory into the correct ARK directory so that the mods auto-management will work.
-if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
-	fixname="steamcmd symlink"
+# if the steamapps symlink is incorrect unlink it.
+if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink ${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps)" != "${HOME}/Steam/steamapps" ]; then
+	fixname="incorrect steamapps symlink"
 	fn_fix_msg_start
-	ln -s "${HOME}/.steam/steamcmd" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
+	unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
 	fn_fix_msg_end
 fi
 
-if [ ! -d "${HOME}/.steam/steamcmd/steamapps" ]; then
-	fixname="steamcmd symlink"
+# Put symlink to steamapps directory into the ARK SteamCMD directory to link the downloaded mods to the correct location.
+if [ ! -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
+	fixname="steamapps symlink"
 	fn_fix_msg_start
-	ln -s "${HOME}/Steam/steamapps" "${HOME}/.steam/steamcmd/steamapps"
+	ln -s "${HOME}/Steam/steamapps" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
 	fn_fix_msg_end
 fi

+ 0 - 2
lgsm/functions/update_factorio.sh

@@ -72,7 +72,6 @@ fn_update_factorio_compare(){
 	remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]')
 	if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}"
 		echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}"
@@ -120,7 +119,6 @@ fn_update_factorio_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}"
 		echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}"

+ 0 - 2
lgsm/functions/update_minecraft.sh

@@ -135,7 +135,6 @@ fn_update_minecraft_compare(){
 	fn_print_dots "Checking for update: ${remotelocation}"
 	if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"
@@ -180,7 +179,6 @@ fn_update_minecraft_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"

+ 0 - 2
lgsm/functions/update_minecraft_bedrock.sh

@@ -104,7 +104,6 @@ fn_update_minecraft_compare(){
 	remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]')
 	if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"
@@ -146,7 +145,6 @@ fn_update_minecraft_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"

+ 0 - 1
lgsm/functions/update_mta.sh

@@ -179,7 +179,6 @@ fn_update_mta_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"

+ 0 - 2
lgsm/functions/update_mumble.sh

@@ -72,7 +72,6 @@ fn_update_mumble_compare(){
 	remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]')
 	if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}"
 		echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}"
@@ -114,7 +113,6 @@ fn_update_mumble_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}"
 		echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}"

+ 4 - 6
lgsm/functions/update_steamcmd.sh

@@ -80,7 +80,6 @@ fn_update_steamcmd_compare(){
 	fn_print_dots "Checking for update: ${remotelocation}"
 	if [ "${localbuild}" != "${remotebuild}" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"
@@ -124,7 +123,6 @@ fn_update_steamcmd_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"
@@ -171,19 +169,19 @@ fn_appmanifest_check(){
 		else
 			fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
 			fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
-			fn_print_info_nl "Forcing update to correct issue"
+			fn_print_info "Forcing update to correct issue"
 			fn_script_log_info "Forcing update to correct issue"
 			fn_update_steamcmd_dl
 		fi
 	elif [ "${appmanifestfilewc}" -eq "0" ]; then
-		fn_print_error_nl "No appmanifest_${appid}.acf found"
+		fn_print_error "No appmanifest_${appid}.acf found"
 		fn_script_log_error "No appmanifest_${appid}.acf found"
-		fn_print_info_nl "Forcing update to correct issue"
+		fn_print_info "Forcing update to correct issue"
 		fn_script_log_info "Forcing update to correct issue"
 		fn_update_steamcmd_dl
 		fn_appmanifest_info
 		if [ "${appmanifestfilewc}" -eq "0" ]; then
-			fn_print_fail_nl "Still no appmanifest_${appid}.acf found"
+			fn_print_fail "Still no appmanifest_${appid}.acf found"
 			fn_script_log_fatal "Still no appmanifest_${appid}.acf found"
 			core_exit.sh
 		fi

+ 0 - 2
lgsm/functions/update_ts3.sh

@@ -136,7 +136,6 @@ fn_update_ts3_compare(){
 	remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]')
 	if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "Update available"
 		echo -e "* Local build: ${red}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"
@@ -178,7 +177,6 @@ fn_update_ts3_compare(){
 		alert.sh
 	else
 		fn_print_ok_nl "Checking for update: ${remotelocation}"
-		echo -en "\n"
 		echo -e "No update available"
 		echo -e "* Local build: ${green}${localbuild}${default}"
 		echo -e "* Remote build: ${green}${remotebuild}${default}"

+ 1 - 1
linuxgsm.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.1.3"
+version="v20.1.4"
 shortname="core"
 gameservername="core"
 rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")