This commit is contained in:
2026-03-02 08:42:41 +00:00
parent 504d237405
commit a421151d13
+3 -3
View File
@@ -44,12 +44,12 @@ def set_shutdown(time, now):
return return
LAST_VALUE = time LAST_VALUE = time
print("[BS Shutdown] shutting down in " + str(time - now) + " seconds") print("[BS Shutdown] shutting down in " + str(time - now) + " seconds")
# subprocess.run(["shutdown", "/s", "/t", (time - now), " "]) subprocess.run(["shutdown", "/s", "/t", (time - now), " "])
def remove_shutdown(): def remove_shutdown():
print("[BS Shutdown] Removed shutdown") print("[BS Shutdown] Removed shutdown")
# subprocess.run(["shutdown", "/a"]) subprocess.run(["shutdown", "/a"])
def update(): def update():
global LAST_VALUE global LAST_VALUE
@@ -77,8 +77,8 @@ def update():
if (LAST_VALUE != 0): if (LAST_VALUE != 0):
remove_shutdown() remove_shutdown()
print("[BS Shutdown] New value") print("[BS Shutdown] New value")
LAST_VALUE = time
set_shutdown(time, now) set_shutdown(time, now)
LAST_VALUE = time
if __name__ == '__main__': if __name__ == '__main__':
while True: while True: