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

+ 11 - 11
lgsm/functions/alert.sh

@@ -104,10 +104,10 @@ elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert
 	fn_print_warn_nl "More Info not enabled"
 	fn_print_warn_nl "More Info not enabled"
 	fn_script_log_warn "More Info alerts not enabled"
 	fn_script_log_warn "More Info alerts not enabled"
 elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "posttarget not set"
+	fn_print_error "posttarget not set"
 	fn_script_error "posttarget not set"
 	fn_script_error "posttarget not set"
 elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "postdays not set"
+	fn_print_error "postdays not set"
 	fn_script_error "postdays not set"
 	fn_script_error "postdays not set"
 fi
 fi
 
 
@@ -117,7 +117,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
 	fn_print_warn_nl "Discord alerts not enabled"
 	fn_print_warn_nl "Discord alerts not enabled"
 	fn_script_log_warn "Discord alerts not enabled"
 	fn_script_log_warn "Discord alerts not enabled"
 elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Discord token not set"
+	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"
 	fn_script_error "Discord token not set"
 fi
 fi
@@ -128,7 +128,7 @@ elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
 	fn_print_warn_nl "Email alerts not enabled"
 	fn_print_warn_nl "Email alerts not enabled"
 	fn_script_log_warn "Email alerts not enabled"
 	fn_script_log_warn "Email alerts not enabled"
 elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Email not set"
+	fn_print_error "Email not set"
 	fn_script_log_error "Email not set"
 	fn_script_log_error "Email not set"
 fi
 fi
 
 
@@ -138,7 +138,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
 	fn_print_warn_nl "IFTTT alerts not enabled"
 	fn_print_warn_nl "IFTTT alerts not enabled"
 	fn_script_log_warn "IFTTT alerts not enabled"
 	fn_script_log_warn "IFTTT alerts not enabled"
 elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "IFTTT token not set"
+	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"
 	fn_script_error "IFTTT token not set"
 fi
 fi
@@ -149,7 +149,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
 	fn_print_warn_nl "Mailgun alerts not enabled"
 	fn_print_warn_nl "Mailgun alerts not enabled"
 	fn_script_log_warn "Mailgun alerts not enabled"
 	fn_script_log_warn "Mailgun alerts not enabled"
 elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Mailgun token not set"
+	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"
 	fn_script_error "Mailgun token not set"
 fi
 fi
@@ -160,7 +160,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test
 	fn_print_warn_nl "Pushbullet alerts not enabled"
 	fn_print_warn_nl "Pushbullet alerts not enabled"
 	fn_script_log_warn "Pushbullet alerts not enabled"
 	fn_script_log_warn "Pushbullet alerts not enabled"
 elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Pushbullet token not set"
+	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"
 	fn_script_error "Pushbullet token not set"
 fi
 fi
@@ -171,7 +171,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
 	fn_print_warn_nl "Pushover alerts not enabled"
 	fn_print_warn_nl "Pushover alerts not enabled"
 	fn_script_log_warn "Pushover alerts not enabled"
 	fn_script_log_warn "Pushover alerts not enabled"
 elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Pushover token not set"
+	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"
 	fn_script_error "Pushover token not set"
 fi
 fi
@@ -182,11 +182,11 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
 	fn_print_warn_nl "Telegram Messages not enabled"
 	fn_print_warn_nl "Telegram Messages not enabled"
 	fn_script_log_warn "Telegram Messages not enabled"
 	fn_script_log_warn "Telegram Messages not enabled"
 elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Telegram token not set."
+	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."
 	fn_script_error "Telegram token not set."
 elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Telegram chat id not set."
+	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."
 	fn_script_error "Telegram chat id not set."
 fi
 fi
@@ -197,7 +197,7 @@ elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
 	fn_print_warn_nl "Slack alerts not enabled"
 	fn_print_warn_nl "Slack alerts not enabled"
 	fn_script_log_warn "Slack alerts not enabled"
 	fn_script_log_warn "Slack alerts not enabled"
 elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
-	fn_print_error_nl "Slack token not set"
+	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"
 	fn_script_error "Slack token not set"
 fi
 fi

+ 4 - 4
lgsm/functions/check_deps.sh

@@ -273,11 +273,11 @@ fn_found_missing_deps(){
 				if [ "${steamcmdfail}" ]; then
 				if [ "${steamcmdfail}" ]; then
 					echo -e ""
 					echo -e ""
 					if [ "${function_selfname}" == "command_install.sh" ]; then
 					if [ "${function_selfname}" == "command_install.sh" ]; then
-						fn_print_failure_nl "Missing dependencies required to run SteamCMD."
+						fn_print_failure "Missing dependencies required to run SteamCMD."
 						fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 						fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 						core_exit.sh
 						core_exit.sh
 					else
 					else
-						fn_print_error_nl "Missing dependencies required to run SteamCMD."
+						fn_print_error "Missing dependencies required to run SteamCMD."
 						fn_script_log_error "Missing dependencies required to run SteamCMD."
 						fn_script_log_error "Missing dependencies required to run SteamCMD."
 					fi
 					fi
 				fi
 				fi
@@ -299,11 +299,11 @@ fn_found_missing_deps(){
 			if [ "${steamcmdfail}" ]; then
 			if [ "${steamcmdfail}" ]; then
 				echo -e ""
 				echo -e ""
 				if [ "${function_selfname}" == "command_install.sh" ]; then
 				if [ "${function_selfname}" == "command_install.sh" ]; then
-					fn_print_failure_nl "Missing dependencies required to run SteamCMD."
+					fn_print_failure "Missing dependencies required to run SteamCMD."
 					fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 					fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 					core_exit.sh
 					core_exit.sh
 				else
 				else
-					fn_print_error_nl "Missing dependencies required to run SteamCMD."
+					fn_print_error "Missing dependencies required to run SteamCMD."
 					fn_script_log_error "Missing dependencies required to run SteamCMD."
 					fn_script_log_error "Missing dependencies required to run SteamCMD."
 				fi
 				fi
 			fi
 			fi

+ 2 - 2
lgsm/functions/command_backup.sh

@@ -43,9 +43,9 @@ fn_backup_init(){
 	info_distro.sh
 	info_distro.sh
 	fn_print_dots "Backup starting"
 	fn_print_dots "Backup starting"
 	fn_script_log_info "Backup starting"
 	fn_script_log_info "Backup starting"
-	fn_print_ok_nl "Backup starting"
+	fn_print_ok "Backup starting"
 	if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
 	if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
-		fn_print_info_nl "There are no previous backups"
+		fn_print_info "There are no previous backups"
 	else
 	else
 		if [ "${lastbackupdaysago}" == "0" ]; then
 		if [ "${lastbackupdaysago}" == "0" ]; then
 			daysago="less than 1 day ago"
 			daysago="less than 1 day ago"

+ 1 - 1
lgsm/functions/command_monitor.sh

@@ -21,7 +21,7 @@ fn_monitor_check_lockfile(){
 		fn_print_error_eol_nl
 		fn_print_error_eol_nl
 		fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
 		fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
 		fn_sleep_time
 		fn_sleep_time
-		echo -e "	* Start ${selfname} to run monitor."
+		echo -e "* Start ${selfname} to run monitor."
 		core_exit.sh
 		core_exit.sh
 	fi
 	fi
 
 

+ 11 - 11
lgsm/functions/core_messages.sh

@@ -149,9 +149,9 @@ fn_print_ok(){
 
 
 fn_print_ok_nl(){
 fn_print_ok_nl(){
 	if [ "${commandaction}" ]; then
 	if [ "${commandaction}" ]; then
-		echo -en "${creeol}[${green}  OK  ${default}] ${commandaction} ${selfname}: $*"
+		echo -e "${creeol}[${green}  OK  ${default}] ${commandaction} ${selfname}: $*"
 	else
 	else
-		echo -en "${creeol}[${green}  OK  ${default}] $*"
+		echo -e "${creeol}[${green}  OK  ${default}] $*"
 	fi
 	fi
 	fn_sleep_time
 	fn_sleep_time
 	echo -en "\n"
 	echo -en "\n"
@@ -169,9 +169,9 @@ fn_print_fail(){
 
 
 fn_print_fail_nl(){
 fn_print_fail_nl(){
 	if [ "${commandaction}" ]; then
 	if [ "${commandaction}" ]; then
-		echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
+		echo -e "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
 	else
 	else
-		echo -en "${creeol}[${red} FAIL ${default}] $*"
+		echo -e "${creeol}[${red} FAIL ${default}] $*"
 	fi
 	fi
 	fn_sleep_time
 	fn_sleep_time
 	echo -en "\n"
 	echo -en "\n"
@@ -189,9 +189,9 @@ fn_print_error(){
 
 
 fn_print_error_nl(){
 fn_print_error_nl(){
 	if [ "${commandaction}" ]; then
 	if [ "${commandaction}" ]; then
-		echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
+		echo -e "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
 	else
 	else
-		echo -en "${creeol}[${red}ERROR ${default}] $*"
+		echo -e "${creeol}[${red}ERROR ${default}] $*"
 	fi
 	fi
 	fn_sleep_time
 	fn_sleep_time
 	echo -en "\n"
 	echo -en "\n"
@@ -209,9 +209,9 @@ fn_print_warn(){
 
 
 fn_print_warn_nl(){
 fn_print_warn_nl(){
 	if [ "${commandaction}" ]; then
 	if [ "${commandaction}" ]; then
-		echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
+		echo -e "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
 	else
 	else
-		echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
+		echo -e "${creeol}[${lightyellow} WARN ${default}] $*"
 	fi
 	fi
 	fn_sleep_time
 	fn_sleep_time
 	echo -en "\n"
 	echo -en "\n"
@@ -229,9 +229,9 @@ fn_print_info(){
 
 
 fn_print_info_nl(){
 fn_print_info_nl(){
 	if [ "${commandaction}" ]; then
 	if [ "${commandaction}" ]; then
-		echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
+		echo -e "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
 	else
 	else
-		echo -en "${creeol}[${cyan} INFO ${default}] $*"
+		echo -e "${creeol}[${cyan} INFO ${default}] $*"
 	fi
 	fi
 	fn_sleep_time
 	fn_sleep_time
 	echo -en "\n"
 	echo -en "\n"
@@ -353,7 +353,7 @@ fn_print_error_eol(){
 }
 }
 
 
 fn_print_error_eol_nl(){
 fn_print_error_eol_nl(){
-	echo -en "${red}ERROR${default}"
+	echo -e "${red}ERROR${default}"
 }
 }
 
 
 # WARN
 # WARN

+ 16 - 4
lgsm/functions/fix_ark.sh

@@ -6,19 +6,31 @@
 
 
 # removes the symlink if broken. fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd
 # 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.
 # rather than ${HOME}/.steam. This fix could be deprecated eventually.
-if [ ! -e "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]||[ ! -e "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
+if [ ! -e "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
 	fixname="broken steamcmd symlink"
 	fixname="broken steamcmd symlink"
 	fn_fix_msg_start
 	fn_fix_msg_start
 	rm -f "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
 	rm -f "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
-	rm -f "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
+	fn_fix_msg_end
+fi
+
+if [ ! -e "${HOME}/.steam/steamcmd/steamapps" ]; then
+	fixname="broken steamcmd symlink"
+	fn_fix_msg_start
+	rm -f "${HOME}/.steam/steamcmd/steamapps"
 	fn_fix_msg_end
 	fn_fix_msg_end
 fi
 fi
 
 
 # Symlinking the SteamCMD directory into the correct ARK directory so that the mods auto-management will work.
 # 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" ]||[ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
+if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then
 	fixname="steamcmd symlink"
 	fixname="steamcmd symlink"
 	fn_fix_msg_start
 	fn_fix_msg_start
 	ln -s "${HOME}/.steam/steamcmd" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
 	ln -s "${HOME}/.steam/steamcmd" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
-	ln -s "${HOME}/Steam/steamapps" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
+	fn_fix_msg_end
+fi
+
+if [ ! -d "${HOME}/.steam/steamcmd/steamapps" ]; then
+	fixname="steamcmd symlink"
+	fn_fix_msg_start
+	ln -s "${HOME}/Steam/steamapps" "${HOME}/.steam/steamcmd/steamapps"
 	fn_fix_msg_end
 	fn_fix_msg_end
 fi
 fi

+ 1 - 1
linuxgsm.sh

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