Daniel Gibbs hai 1 ano
pai
achega
7d9df6856e
Modificáronse 3 ficheiros con 18 adicións e 14 borrados
  1. 5 0
      lgsm/modules/command_dev_ui.sh
  2. 12 13
      lgsm/modules/command_wipe.sh
  3. 1 1
      lgsm/modules/fix_rust.sh

+ 5 - 0
lgsm/modules/command_dev_ui.sh

@@ -102,4 +102,9 @@ fn_print_update_eol_nl
 fn_print "Print skip message with eol"
 fn_print_skip_eol_nl
 
+fn_print_nl ""
+fn_print_nl "${lightgreen}Restart warning${default}"
+fn_messages_separator
+fn_print_restart_warning
+
 core_exit.sh

+ 12 - 13
lgsm/modules/command_wipe.sh

@@ -29,14 +29,14 @@ fn_wipe_files() {
 	# Remove Map files
 	if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
 		if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then
-			echo -en "removing .map file(s)..."
+			fn_print "removing .map file(s)..."
 			fn_script_log_info "Removing *.map file(s)"
 			fn_sleep_time
 			find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}"
 			find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}"
 			fn_wipe_exit_code
 		else
-			echo -e "no .map file(s) to remove"
+			fn_print_nl "no .map file(s) to remove"
 			fn_sleep_time
 			fn_script_log_pass "no .map file(s) to remove"
 		fi
@@ -44,14 +44,14 @@ fn_wipe_files() {
 	# Remove Save files.
 	if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
 		if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then
-			echo -en "removing .sav file(s)..."
+			fn_print "removing .sav file(s)..."
 			fn_script_log_info "Removing .sav file(s)"
 			fn_sleep_time
 			find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}"
 			find "${serveridentitydir:?}" -type f -name "*.sav*" -delete
 			fn_wipe_exit_code
 		else
-			echo -e "no .sav file(s) to remove"
+			fn_print_nl "no .sav file(s) to remove"
 			fn_script_log_pass "no .sav file(s) to remove"
 			fn_sleep_time
 		fi
@@ -60,14 +60,14 @@ fn_wipe_files() {
 	# Excluding player.tokens.db for Rust+.
 	if [ -n "${serverwipe}" ]; then
 		if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then
-			echo -en "removing .db file(s)..."
+			fn_print "removing .db file(s)..."
 			fn_script_log_info "Removing .db file(s)"
 			fn_sleep_time
 			find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}"
 			find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete
 			fn_wipe_exit_code
 		else
-			echo -e "no .db file(s) to remove"
+			fn_print_nl "no .db file(s) to remove"
 			fn_sleep_time
 			fn_script_log_pass "no .db file(s) to remove"
 		fi
@@ -104,13 +104,13 @@ fn_full_wipe_warning() {
 	fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data"
 }
 
-# Will change the seed if the seed is not defined by the user.
+# If the seed is not defined by the user, generate a seed file.
 fn_wipe_random_seed() {
 	if [ -f "${datadir}/${selfname}-seed.txt" ] && [ -n "${randomseed}" ]; then
 		shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"
 		seed=$(cat "${datadir}/${selfname}-seed.txt")
 		randomseed=1
-		echo -en "generating new random seed (${cyan}${seed}${default})..."
+		fn_print "generating new random seed (${cyan}${seed}${default})..."
 		fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})"
 		fn_sleep_time
 		fn_print_ok_eol_nl
@@ -120,21 +120,21 @@ fn_wipe_random_seed() {
 # A summary of what wipe is going to do.
 fn_wipe_details() {
 	fn_print_information_nl "Wipe does not remove Rust+ data."
-	echo -en "* Wipe map data: "
+	fn_print "* Wipe map data "
 	if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
 		fn_print_yes_eol_nl
 	else
 		fn_print_no_eol_nl
 	fi
 
-	echo -en "* Wipe blueprint data: "
+	fn_print "* Wipe blueprint data "
 	if [ -n "${serverwipe}" ]; then
 		fn_print_yes_eol_nl
 	else
 		fn_print_no_eol_nl
 	fi
 
-	echo -en "* Change Procedural Map seed: "
+	fn_print "* Change Procedural Map seed "
 	if [ -n "${randomseed}" ]; then
 		fn_print_yes_eol_nl
 	else
@@ -142,10 +142,9 @@ fn_wipe_details() {
 	fi
 }
 
-fn_print_dots ""
 check.sh
 fix_rust.sh
-
+fn_print_dots ""
 # Check if there is something to wipe.
 if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ] && [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then
 	if [ -n "${serverwipe}" ]; then

+ 1 - 1
lgsm/modules/fix_rust.sh

@@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64"
 
 # Part of random seed feature.
-# If seed is not defined by user generate a seed file.
+# If the seed is not defined by the user, generate a seed file.
 if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then
 	if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then
 		shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"