Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP. Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
|
|
def main() -> int:
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect(
|
|
"107.173.30.245",
|
|
4014,
|
|
"eric",
|
|
"4669805",
|
|
timeout=40,
|
|
banner_timeout=80,
|
|
allow_agent=False,
|
|
look_for_keys=False,
|
|
)
|
|
cmd = r"""echo '4669805' | sudo -S -p '' bash -c '
|
|
echo === apt proxy files ===
|
|
ls -la /etc/apt/apt.conf.d/*proxy* 2>/dev/null || echo none
|
|
for f in /etc/apt/apt.conf.d/*proxy*; do
|
|
[ -f "$f" ] || continue
|
|
echo --- "$f" ---
|
|
cat "$f"
|
|
done
|
|
echo === docker proxy ===
|
|
cat /etc/systemd/system/docker.service.d/http-proxy.conf 2>/dev/null || echo no_docker_proxy
|
|
echo === env ===
|
|
env | grep -i proxy || echo no_env_proxy
|
|
echo === sc ===
|
|
systemctl is-active shellcrash
|
|
ss -ltn | grep -E ":(7890|9999)" || true
|
|
curl -sS -m 5 -o /dev/null -w "sc_mixed:%{http_code}\n" -x http://127.0.0.1:7890 https://www.google.com/generate_204 || echo sc_mixed:fail
|
|
# remove leftover apt proxy if any (not ours named 99douyinweb)
|
|
rm -f /etc/apt/apt.conf.d/99douyinweb-tmp-proxy /etc/apt/apt.conf.d/99live-proxy
|
|
echo cleared_ours
|
|
'"""
|
|
_, o, e = c.exec_command(cmd, timeout=60)
|
|
print((o.read() + e.read()).decode("utf-8", "replace"))
|
|
c.close()
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|