Live testing

This commit is contained in:
Anton Hvornum 2019-04-11 22:56:24 +02:00
parent 5c3089e7f9
commit 9e8179d25b
1 changed files with 6 additions and 3 deletions

View File

@ -172,15 +172,18 @@ class sys_command():
print('[N] Writing to subsystem: {}'.format(self.opts['triggers'][trigger])) print('[N] Writing to subsystem: {}'.format(self.opts['triggers'][trigger]))
os.write(child_fd, self.opts['triggers'][trigger]) os.write(child_fd, self.opts['triggers'][trigger])
del(self.opts['triggers'][trigger]) del(self.opts['triggers'][trigger])
## Adding a exit trigger:
if len(self.opts['triggers']) == 0: if len(self.opts['triggers']) == 0:
alive = False if b'[root@arcinstall ~]#' in output:
break alive = False
break
yield output yield output
# Since we're in a subsystem, we gotta bail out! # Since we're in a subsystem, we gotta bail out!
# Bail bail bail! # Bail bail bail!
os.write(child_fd, b'shutdown now') os.write(child_fd, b'shutdown now\n')
exit_code = os.waitpid(self.pid, 0)[1] exit_code = os.waitpid(self.pid, 0)[1]
if exit_code != 0: if exit_code != 0: