#!/usr/bin/env python3 """Test: remove hysteria ports hop temporarily and re-delay.""" from __future__ import annotations import sys import time import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace", line_buffering=True) c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("107.173.30.245", 4014, "eric", "4669805", timeout=25, banner_timeout=40, allow_agent=False, look_for_keys=False) print("connected guest", flush=True) cmd = r''' echo 4669805 | sudo -S -p '' bash -lc ' set -e # backup runtime config cp -a /tmp/ShellCrash/config.yaml /tmp/ShellCrash/config.yaml.bak.hysteria_ports # remove ONLY the ports line under hysteria5 block (first occurrence after the name) python3 - <", o.channel.recv_exit_status(), flush=True) c.close() print("DONE", flush=True)