Cleaned up deploy script, moved ip detector to a separate script.