From 63dd85ed11e83bacbf9b7284c462205e522322f2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 Mar 2021 20:20:49 +0100 Subject: [PATCH] new seed happens before server start --- lgsm/functions/command_wipe.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 63cb830fb..9979dabb5 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -25,7 +25,7 @@ fn_wipe_exit_code(){ fn_wipe_server_files(){ fn_print_start_nl "Wiping server" fn_script_log_info "Wiping server" - # Wipe procedural map. + # Wipe Procedural map. if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then echo -en "removing procedural map proceduralmap.*.map file(s)..." fn_sleep_time @@ -201,6 +201,7 @@ fn_wipe_warning(){ # Will change the seed everytime the wipe command is run if the seed in config is not set. fn_wipe_random_seed(){ shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + seed=$(cat "${datadir}/${selfname}-seed.txt") } fn_print_dots "" @@ -216,6 +217,7 @@ if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ command_stop.sh fn_firstcommand_reset fn_wipe_server_files + fn_wipe_random_seed exitbypass=1 command_start.sh fn_firstcommand_reset @@ -224,7 +226,7 @@ if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ fi fn_print_complete_nl "Wiping ${selfname}" fn_script_log_pass "Wiping ${selfname}" - fn_wipe_random_seed + else fn_print_ok_nl "Wipe not required" fn_script_log_pass "Wipe not required"