douyinWEB/scripts/_fix_dylive_neko6_perms.py
2026-09-13 22:10:49 -05:00

33 lines
937 B
Python

#!/usr/bin/env python3
from __future__ import annotations
import sys
import paramiko
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(
"107.173.30.245",
22,
"root",
"Xiao4669805",
timeout=40,
allow_agent=False,
look_for_keys=False,
banner_timeout=120,
)
_i, o, e = c.exec_command(
r"""
set +e
chown -R 1000:1000 /opt/douyinWEB/backend/data/neko/profiles/6
ls -la /opt/douyinWEB/backend/data/neko/profiles/6/Default | sed -n '1,15p'
docker exec douyinweb-neko-6 sh -c 'id neko; ls -la /home/neko/.config/google-chrome/Default | sed -n "1,12p"; supervisorctl status google-chrome; curl -sS -m 3 http://127.0.0.1:9222/json/version'
echo
docker ps --filter name=douyinweb-neko-6 --format '{{.Names}} {{.Status}}'
""",
timeout=60,
)
print((o.read() + e.read()).decode("utf-8", "replace"))
c.close()