import paramiko
import sys
import time

HOST = "135.125.102.180"
USER = "ubuntu"
PASS = "BotPascal2026!"

def main():
    try:
        ssh = paramiko.SSHClient()
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        print("Connecting for reboot...")
        ssh.connect(HOST, username=USER, password=PASS, timeout=10)
        
        print("Sending reboot command...")
        # execute non-blocking or accept that it will disconnect
        try:
            ssh.exec_command("sudo reboot")
        except:
            pass
        print("Reboot command sent.")
        ssh.close()
    except Exception as e:
        print("Error:", e)

if __name__ == "__main__":
    main()
