Initial commit
This commit is contained in:
commit
f45881dc88
161 files changed
+21597
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import pexpect, time
|
||||
|
||||
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('ps aux | grep deploy_velobase | grep -v grep || echo SCRIPT_DONE')
|
||||
c.expect('[$#]')
|
||||
alive = c.before.strip()
|
||||
print('=== ALIVE ===')
|
||||
print(alive[-300:])
|
||||
|
||||
if 'SCRIPT_DONE' in alive:
|
||||
c.sendline('tail -30 /tmp/deploy_velobase.log 2>/dev/null')
|
||||
c.expect('[$#]')
|
||||
print('=== LOG ===')
|
||||
print(c.before.strip()[-2000:])
|
||||
else:
|
||||
print('Script still running...')
|
||||
|
||||
c.sendline('exit')
|
||||
Reference in new issue
Block a user