private static void Network() { RunningConfiguration.Network.NetworkInterfaces = cmds.Network.Get(); cmds.Network.SetTuns(); cmds.Network.SetTaps(); Brctl.Apply(); Bond.Apply(); RunningConfiguration.Network.NetworkInterfaces = cmds.Network.Get(); cmds.Network.Prepare(); WiFi.Apply(); cmds.Network.Set(); cmds.Network.ApplyNetwork(CurrentConfiguration.Network.InternalNetwork); cmds.Network.ApplyNetwork(CurrentConfiguration.Network.ExternalNetwork); Route.SetRoutingTable(); Route.Set(); ConsoleLogger.Log("[network] ready"); }
public WiFiModule() : base("/wifi") { Get["/"] = x => { return JsonConvert.SerializeObject(Application.CurrentConfiguration.Network.WpaSupplicant); }; Post["/save"] = x => { string data = Request.Form.Data; var objects = JsonConvert.DeserializeObject<WpaSupplicant>(data); Application.CurrentConfiguration.Network.WpaSupplicant = objects; ConfigRepo.Save(); return HttpStatusCode.OK; }; Post["/apply"] = x => { WiFi.Apply(); return HttpStatusCode.OK; }; }