20 lines
615 B
Python
20 lines
615 B
Python
import paramiko
|
|
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
|
|
|
def run(cmd):
|
|
print(f"=== {cmd} ===")
|
|
_, out, err = ssh.exec_command(cmd)
|
|
res = out.read().decode('utf-8', errors='replace').strip()
|
|
if res:
|
|
print(res)
|
|
|
|
run("sudo docker service inspect peanut_peanut --format '{{json .Spec.TaskTemplate.ContainerSpec.Mounts}}'")
|
|
run("find /mnt/ -name 'settings.yml' 2>/dev/null")
|
|
run("find /mnt/ -name '*peanut*' 2>/dev/null")
|
|
|
|
ssh.close()
|
|
|