Changed the run/restart script to check and wait for the port to clear, before attempting to restart