From ae6d811fd90a13d1c4aa6655548d1527e56a2c52 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 31 Jul 2023 00:39:45 +0100 Subject: [PATCH] refactor: improve file path handling in check_last_update.sh The code changes refactor the file path handling in check_last_update.sh to use the correct lock directory. This ensures that the last update time is correctly retrieved and compared with the last start time. --- lgsm/modules/check_last_update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/check_last_update.sh b/lgsm/modules/check_last_update.sh index 79e731e4c..02d17c975 100644 --- a/lgsm/modules/check_last_update.sh +++ b/lgsm/modules/check_last_update.sh @@ -11,12 +11,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then laststart=$(cat "${lockdir}/${selfname}-last-started.lock") fi -if [ -f last-updated.lock" ]; then - lastupdate=$(cat last-updated.lock") +if [ -f "${lockdir}/last-updated.lock" ]; then + lastupdate=$(cat "${lockdir}/last-updated.lock") fi check_status.sh -if [ -f last-updated.lock" ] && [ "${status}" != "0" ]; then +if [ -f "${lockdir}/last-updated.lock" ] && [ "${status}" != "0" ]; then if [ ! -f "${lockdir}/${selfname}-last-started.lock" ] || [ "${laststart}" -lt "${lastupdate}" ]; then fn_print_info "${selfname} has not been restarted since last update" fn_script_log_info "${selfname} has not been restarted since last update"