From 592cdd2b400f5f09b5d459e1838221cd36c1637a Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Tue, 13 Aug 2024 18:55:03 +0300 Subject: [PATCH] oops --- shutdown_ups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutdown_ups.py b/shutdown_ups.py index b6a3508..42d3d7e 100644 --- a/shutdown_ups.py +++ b/shutdown_ups.py @@ -92,7 +92,7 @@ def main(): shutdown_status = run_command('shutdown --show') - if (state == "on-battery") and (time_on_battery > TIME_THRESHOLD) and ("No scheduled shutdown" in shutdown_status): + if (state == "on-battery") and (time_on_battery < TIME_THRESHOLD) and ("No scheduled shutdown" in shutdown_status): print("UPS is failing, shutting down in 60 seconds...", flush=True) send_email(f"{socket.gethostname()}@vvzvlad.xyz", "UPS is failing, shutting down in 60 seconds...", f"Proxmox node '{socket.gethostname()}': UPS is failing, shutting down in 60 seconds...",