new plugin (main.py; main_main.py is old one) with state machine takes some shape. it needs killing ssh processes on exit and few other things.