   @spec restart :: :ok | {:error, term}
   def restart do
     Logger.debug ">> is waiting for interfaces to come down."
-    GenServer.exit(__MODULE__, :restart)
+    GenServer.stop(__MODULE__, :restart)
   end
 
   @doc """

    interfaces = config["interfaces"]
    if interfaces do
      for interface <- interfaces do
         :ok = stop_interface(interface, state.event_manager)
      end
    end
  end

  defp stop_interface({iface, settings}, event_manager) do

  end
end


  # when this closes clean up everything
  def terminate(_reason,state) do
    Nerves.Firmware.reboot
    do_all_down(state)
  end

