26 lines
893 B
Python
26 lines
893 B
Python
import paramiko
|
|
|
|
client = paramiko.SSHClient()
|
|
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
client.connect('152.136.232.83', port=22, username='root', password='Jianhua105', timeout=10)
|
|
|
|
def run(cmd):
|
|
print(f"\n>>> {cmd[:120]}")
|
|
stdin, stdout, stderr = client.exec_command(cmd, timeout=15)
|
|
out = stdout.read().decode('utf-8', errors='replace').strip()
|
|
if out: print(out[-600:])
|
|
return out
|
|
|
|
# Find database path in server.js
|
|
run("grep -n 'sqlite\\|database\\|\\.db' /www/wwwroot/ipzhinengti/server.js | head -10")
|
|
|
|
# Find all .db files
|
|
run("find /www/wwwroot/ipzhinengti -name '*.db' 2>/dev/null")
|
|
run("find /www/wwwroot/ipzhinengti -name '*.sqlite' 2>/dev/null")
|
|
|
|
# Check data dir
|
|
run("ls -la /www/wwwroot/ipzhinengti/data/ 2>/dev/null || echo 'no data dir'")
|
|
run("ls -la /www/wwwroot/ipzhinengti/*.db 2>/dev/null || echo 'no .db in root'")
|
|
|
|
client.close()
|