Răsfoiți Sursa

Merged feature/ultimatebyte-0223 into develop

Daniel Gibbs 9 ani în urmă
părinte
comite
613c91d168

+ 6 - 6
lgsm/functions/command_start.sh

@@ -85,15 +85,15 @@ fn_start_tmux(){
 
 	# tmux pipe-pane not supported in tmux versions < 1.6
 	if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then
-		echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}"
-		echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}"
-		echo "Currently installed: $(tmux -V)" >> "${consolelog}"
+		echo "Console logging disabled: Tmux => 1.6 required
+		https://gameservermanagers.com/tmux-upgrade
+		Currently installed: $(tmux -V)" > "${consolelog}"
 
 	# Console logging disabled: Bug in tmux 1.8 breaks logging
 	elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then
-		echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}"
-		echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}"
-		echo "Currently installed: $(tmux -V)" >> "${consolelog}"
+		echo "Console logging disabled: Bug in tmux 1.8 breaks logging
+		https://gameservermanagers.com/tmux-upgrade
+		Currently installed: $(tmux -V)" > "${consolelog}"
 
 	# Console logging enable or not set
 	elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then

+ 1 - 1
lgsm/functions/command_stop.sh

@@ -272,7 +272,7 @@ fn_stop_ark(){
 			pid=${pid//[!0-9]/}
 			let pid+=0 # turns an empty string into a valid number, '0',
 			# and a valid numeric pid remains unchanged.
-			if [ "${pid}" -gt 1 && "${pid}" -le $(cat /proc/sys/kernel/pid_max) ]; then
+			if [ "${pid}" -gt 1 ]&&[ "${pid}" -le $(cat /proc/sys/kernel/pid_max) ]; then
 			fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}"
 				sleep 1
 			else

+ 2 - 5
lgsm/functions/command_ts3_server_pass.sh

@@ -6,15 +6,12 @@
 # Description: Changes TS3 serveradmin password.
 
 local commandname="TS3-CHANGE-PASS"
-local commandaction="TS3 Change Password"
+local commandaction="ServerAdmin Password Change"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 
 fn_serveradmin_password_prompt(){
-	echo ""
-	echo "${gamename} ServerAdmin Password Change"
-	echo "================================="
-	echo ""
+	fn_print_header
 	echo "Press \"CTRL+b d\" to exit console."
 	fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password."
 	fn_print_warning_nl "${gamename} will restart during this process."

+ 19 - 6
lgsm/functions/command_wipe.sh

@@ -45,11 +45,24 @@ fn_wipe_server_remove_files(){
 	# Rust Wipe
 	if [ "${gamename}" == "Rust" ]; then
 		if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.sav")" ]; then
-			currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.sav"
-			echo -en "Removing map proceduralmap.*.sav file(s)..."
+			currentaction="Removing map save(s): ${serveridentitydir}/proceduralmap.*.sav"
+			echo -en "Removing map saves proceduralmap.*.sav file(s)..."
 			sleep 1
 			fn_script_log "${currentaction}"
-			find "${serveridentitydir}" -type f -name "proceduralmap.*.sav" -delete
+			find "${serveridentitydir:?}" -type f -name "proceduralmap.*.sav" -delete
+			fn_wipe_exit_code
+			sleep 0.5
+		else
+			fn_print_information_nl "No map save to remove"
+			fn_script_log_info "No map save to remove."
+			sleep 0.5
+		fi
+		if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then
+			currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map"
+			echo -en "Removing map proceduralmap.*.map file(s)..."
+			sleep 1
+			fn_script_log "${currentaction}"
+			find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete
 			fn_wipe_exit_code
 			sleep 0.5
 		else
@@ -62,7 +75,7 @@ fn_wipe_server_remove_files(){
 			echo -en "Removing user directory..."
 			sleep 1
 			fn_script_log "${currentaction}"
-			rm -rf "${serveridentitydir}/user"
+			rm -rf "${serveridentitydir:?}/user"
 			fn_wipe_exit_code
 			sleep 0.5
 		else
@@ -75,7 +88,7 @@ fn_wipe_server_remove_files(){
 			echo -en "Removing storage directory..."
 			sleep 1
 			fn_script_log "${currentaction}"
-			rm -rf "${serveridentitydir}/storage"
+			rm -rf "${serveridentitydir:?}/storage"
 			fn_wipe_exit_code
 			sleep 0.5
 		else
@@ -88,7 +101,7 @@ fn_wipe_server_remove_files(){
 			echo -en "Removing Log files..."
 			sleep 1
 			fn_script_log "${currentaction}"
-			find "${serveridentitydir}" -type f -name "Log.*.txt" -delete
+			find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete
 			fn_wipe_exit_code
 			sleep 0.5
 		else

+ 1 - 3
lgsm/functions/compress_unreal2_maps.sh

@@ -8,9 +8,7 @@ local commandaction="Unreal Map Compressor"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
-clear
-echo "${gamename} Map Compressor"
-echo "================================="
+fn_print_header
 echo "Will compress all maps in:"
 echo ""
 pwd

+ 1 - 3
lgsm/functions/compress_ut99_maps.sh

@@ -8,9 +8,7 @@ local commandaction="Unreal Map Compressor"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
-clear
-echo "${gamename} Map Compressor"
-echo "================================="
+fn_print_header
 echo "Will compress all maps in:"
 echo ""
 pwd