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(f"Connecting to {HOST}...")
        ssh.connect(HOST, username=USER, password=PASS)
        
        print("Sending reboot command...")
        # reboot returns immediately or disconnects, so we expect an error or closed connection
        try:
            ssh.exec_command("sudo reboot")
        except Exception:
            pass # Expected disconnection
            
        print("Reboot signal sent. VPS will be back in ~1-2 minutes.")
        ssh.close()
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()
