Added automatic restart function to deploy command