thsf.net/maintenance/reboot.py

14 lines
383 B
Python
Raw Permalink Normal View History

2023-05-27 14:25:10 +11:00
#!/usr/bin/python3
import docker
client = docker.from_env()
for container in client.containers.list():
if container.name == "thsf":
2023-05-27 19:02:16 +11:00
print("Content-type: text/html\n\n")
2023-05-27 14:25:10 +11:00
print("[+] Rebooting container<br>")
print(" '-> Stopping container<br>")
container.stop()
print(" '-> Starting container<br>")
container.start()
2023-05-27 19:02:16 +11:00
print("[+] Container restarted<br>")