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...",