Files
fotkyBuzalkovi/00 PictureCollector/ssh_find_userscripts.py
T
administrator d62b1a801c notebookVb
2026-05-24 06:55:47 +02:00

19 lines
660 B
Python

import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect("192.168.1.76", username="root", password="7309208104",
look_for_keys=False, allow_agent=False)
def run(cmd):
_, stdout, stderr = client.exec_command(cmd)
out = stdout.read().decode().strip()
err = stderr.read().decode().strip()
if out: print(out)
if err: print(f"[err] {err}")
run("find /boot/config/plugins/user.scripts/scripts -maxdepth 2 -type d 2>/dev/null || echo 'NENALEZENO'")
run("ls /boot/config/plugins/user.scripts/scripts/ 2>/dev/null || echo 'prazdne nebo neexistuje'")
client.close()