12 lines
493 B
Python
12 lines
493 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('echo "=== PNPM ===" && tail -5 /tmp/pnpm_install.log 2>/dev/null && echo "=== PG ===" && tail -5 /tmp/pg_pull.log 2>/dev/null && echo "=== PS ===" && ps aux | grep -E "pnpm|docker pull" | grep -v grep || echo DONE')
|
|
c.expect('[$#]')
|
|
print('STATUS:', c.before.strip()[-1500:])
|
|
|
|
c.sendline('exit') |