13 lines
364 B
Python
13 lines
364 B
Python
import pexpect
|
|
|
|
c = pexpect.spawn('ssh -q -o StrictHostKeyChecking=no root@210.16.161.214', encoding='utf-8', timeout=30)
|
|
c.expect('password:')
|
|
c.sendline('XHR521yhf')
|
|
c.expect('[$#]')
|
|
|
|
c.sendline("docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep velob")
|
|
c.expect('[$#]')
|
|
print('CONTAINERS:')
|
|
print(c.before.strip()[-600:])
|
|
|
|
c.sendline('exit') |