From e4571d58b1ea895270534bdbcd222fd76b6d997c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 31 Jul 2023 01:02:13 +0100 Subject: [PATCH] feat: add update lock file Add functionality to create an update lock file when validating and updating SteamCMD. This prevents potential conflicts with customised files. - Create a lock file with the current timestamp in the "command_validate.sh" script - Create a lock file with the current timestamp in the "update_steamcmd.sh" script --- lgsm/modules/command_validate.sh | 2 +- lgsm/modules/update_steamcmd.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh index ecd2ed141..f4a6250f3 100644 --- a/lgsm/modules/command_validate.sh +++ b/lgsm/modules/command_validate.sh @@ -23,7 +23,7 @@ fn_validate() { fi done fn_print_warn_nl "Validate might overwrite some customised files" - + date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd } diff --git a/lgsm/modules/update_steamcmd.sh b/lgsm/modules/update_steamcmd.sh index 096859b97..20a85ab93 100644 --- a/lgsm/modules/update_steamcmd.sh +++ b/lgsm/modules/update_steamcmd.sh @@ -23,6 +23,7 @@ if [ "${forceupdate}" == "1" ]; then exitbypass=1 command_stop.sh fn_firstcommand_reset + date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd date +%s > "${lockdir}/last-updated.lock" exitbypass=1