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>
18 lines
684 B
Python
18 lines
684 B
Python
import paramiko
|
|
import time
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("107.173.30.245", 22, "root", "Xiao4669805", timeout=15, allow_agent=False, look_for_keys=False)
|
|
|
|
def run(cmd, timeout=360):
|
|
_, out, err = c.exec_command(cmd, timeout=timeout)
|
|
return out.read().decode("utf-8", "replace").strip()
|
|
|
|
print(run("cd /opt/douyinWEB && git pull origin dev 2>&1"))
|
|
print(run("cd /opt/douyinWEB/frontend && npm run build 2>&1 | tail -8").encode("ascii", "replace").decode())
|
|
c.exec_command("systemctl restart douyinweb-web >/dev/null 2>&1", timeout=5)
|
|
time.sleep(5)
|
|
print("web:", run("systemctl is-active douyinweb-web"))
|
|
c.close()
|