18 lines
655 B
Python
18 lines
655 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)
|
|
|
|
_, out, _ = ssh.exec_command("sudo docker service inspect peanut_peanut --format '{{json .Spec.TaskTemplate.ContainerSpec.Mounts}}'")
|
|
print("Mounts:", out.read().decode())
|
|
|
|
_, out2, _ = ssh.exec_command("ls -la /mnt/swarm_shared/legacy_volumes/peanut/")
|
|
print("Files:", out2.read().decode())
|
|
|
|
_, out3, _ = ssh.exec_command("cat /mnt/swarm_shared/legacy_volumes/peanut/settings.yml")
|
|
print("Settings:", out3.read().decode())
|
|
|
|
ssh.close()
|
|
|