sh2/d2ypp2/tools/read_lane_ini_both.py
2026-06-14 10:41:48 -05:00

20 lines
956 B
Python

#!/usr/bin/env python3
import paramiko
def q(host, pw, cmd):
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(host, username='eric', password=pw, timeout=15)
_, o, e = c.exec_command(cmd, timeout=60, get_pty=True)
return (o.read()+e.read()).decode('utf-8','replace')
pw='4669805'
for host, base in [('10.88.0.5','/opt/live/d2ypp'), ('10.88.0.4','/home/eric/d2ypp2-src')]:
print('\n===', host, '===')
for cmd in [
f'cat {base}/config/youtube.youtube2__ch_mp9mm36r_2wn0r.ini 2>/dev/null || ls {base}/config/youtube.youtube2__*.ini | head -1 | xargs cat 2>/dev/null',
f"grep -E 'SHELLCRASH|YOUTUBE|PUSH|RELAY|PROXY' {base}/config/system-stack.env 2>/dev/null",
f'grep relay_strategy {base}/config/hardware-profile.json 2>/dev/null -A12 | head -15',
]:
print('>', cmd[:90])
print(q(host,pw,cmd)[:2000].encode('ascii','backslashreplace').decode())