WIP: functions for provision script and more proper restart