22 lines
635 B
Python
22 lines
635 B
Python
import paramiko
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("140.44.4.71", username="snarf", password="Katzir476!", timeout=10)
|
|
|
|
def run_npm(cmd):
|
|
full_cmd = f"echo Katzir476! | sudo -S docker exec $(docker ps -q -f name=nginx-proxy-manager) {cmd}"
|
|
_, o, e = c.exec_command(full_cmd)
|
|
return o.read().decode().strip(), e.read().decode().strip()
|
|
|
|
print("=== PORTAL (4.conf) ===")
|
|
out, _ = run_npm("cat /data/nginx/proxy_host/4.conf")
|
|
print(out)
|
|
|
|
print("\n=== WILDCARD (*.snarfnet.net) (1.conf) ===")
|
|
out, _ = run_npm("cat /data/nginx/proxy_host/1.conf")
|
|
print(out)
|
|
|
|
c.close()
|
|
|