added function to check if docker container has exited prematurely before running ip commands