accurate detect restart scripts