From 83d7b00e078aee3af85e4e237569a25e45ca3b3a Mon Sep 17 00:00:00 2001 From: Kaleb Phipps Date: Mon, 15 Dec 2025 21:28:07 +0100 Subject: [PATCH] adjust script to stop never ending emails --- html/check_website_and_mount.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/html/check_website_and_mount.py b/html/check_website_and_mount.py index 41152e3..361234d 100644 --- a/html/check_website_and_mount.py +++ b/html/check_website_and_mount.py @@ -138,8 +138,18 @@ def is_vm_reachable(host: str) -> bool: # Exit without print. sys.exit(0) elif not email_body and os.path.exists(LOCK_FILE): - print("🚨 PAINT ALERT - The PAINT Error Detection System is Locked 🚨\n") + # If everything is working remove lock file and report this action. print( - "It looks like PAINT is running fine, but the lock file has not yet been deleted!\n Please delete the" - f"lock file located at ``{LOCK_FILE}`` so the error detection system can run as desired!" + "✅ PAINT ALERT - The PAINT Error Detection System is Alive - LOCK FILE DELETED ✅\n" ) + print( + "It appears that PAINT has successfully self-repaired. All critical checks are now passing.\n" + f"The lock file (``{LOCK_FILE}``) has been **automatically deleted** to resume normal monitoring.\n\n" + "**Action Required:** Please verify the system integrity to ensure the fix is permanent." + ) + + # Delete the lock file. + os.remove(LOCK_FILE) + else: + # Nothing needs to be done (case should not be reached). + sys.exit(0)