From d39a861e1d291d3267f2da78670f41ec7494ad77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Thu, 19 Apr 2018 16:23:46 +0200 Subject: [PATCH] Implement seppuku command --- solvable/src/event_handler_main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index 5681adf..d0b64be 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -34,6 +34,15 @@ class TestCommands(TerminalCommands): 'next_visibility': self.togglenext_visible}}) self.togglenext_visible = not self.togglenext_visible + def command_seppuku_tfw(self, *args): + seppuku = ('nohup sh -c "supervisorctl restart tfwserver event_handler_main" &> /dev/null & ' + 'clear && echo "Committed seppuku! :)" && sleep infinity') + TFWServerConnector().send_to_eventhandler({ + 'key': 'shell', + 'data': {'command': 'write', + 'shellcmd': f'{seppuku}\n'} + }) + if __name__ == '__main__': # pylint: disable=invalid-name