public static bool DeleteNetworkAdapter(string bridge, string networkAdapter) { var args = CommonString.Append(delifArg, " ", bridge, " ", networkAdapter); CommonProcess.Do(brctlFileLocation, args); return(true); }
public static bool SetChassis(string chassis) { var args = CommonString.Append(setChassisArg, " ", chassis); CommonProcess.Do(hostnamectlFileLocation, args); return(true); }
public static bool SetLocation(string location) { var args = CommonString.Append(setLocationArg, " ", location); CommonProcess.Do(hostnamectlFileLocation, args); return(true); }
public static bool DeleteBroadcast(string networkAdapter, string address, string range, string broadcast) { var args = CommonString.Append("addr del ", address, "/", range, " broadcast ", broadcast, " dev ", networkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool DeleteNetworkAdapted(string networkAdapter) { var args = CommonString.Append("link del ", networkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool SetNetworkAdapterTxqueuelen(string networkAdapter, string txqueuelenValue) { var args = CommonString.Append("link set dev ", networkAdapter, " txqueuelen ", txqueuelenValue); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool AddNat(string address, string secondAddress) { var args = CommonString.Append("route add nat ", address, " via ", secondAddress); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool Dompmwakeup(string domain) { var args = CommonString.Append(dompmwakeupArg, " ", domain); CommonProcess.Do(virshFileLocation, args); return(true); }
public static bool Restore(string domain) { var args = CommonString.Append(restoreArg, " ", domain); CommonProcess.Do(virshFileLocation, args); return(true); }
public static void Start() { var args = CommonString.Append(nftArgs, nftablesFile); CommonProcess.Do(nftFileLocation, args); ConsoleLogger.Log("[firewall] start"); }
public static bool Shutdown(string domain) { var args = CommonString.Append(shutdownArg, " ", domain); CommonProcess.Do(virshFileLocation, args); return(true); }
public static bool Reload(string unit) { var args = CommonString.Append(reloadArg, " ", unit); CommonProcess.Do(systemctlFileLocation, args); return(true); }
public static bool SetPathCost(string bridge, string path, string cost) { var args = CommonString.Append("setpathcost ", bridge, " ", path, " ", cost, " set path cost"); CommonProcess.Do(brctlFileLocation, args); return(true); }
public static bool SetStpOff(string bridge) { var args = CommonString.Append(stpArg, " ", bridge, " off"); CommonProcess.Do(brctlFileLocation, args); return(true); }
public static bool SetNetworkAdapterPromiscOff(string networkAdapter) { var args = CommonString.Append("link set dev ", networkAdapter, " promisc off"); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool SetTimezone(string timezone) { var args = CommonString.Append(setTimezoneArg, " ", timezone); CommonProcess.Do(timedatectlFileLocation, args); return(true); }
public static bool SetNetworkAdapterMTU(string networkAdapter, string mtuValue) { var args = CommonString.Append("link set dev ", networkAdapter, " mtu ", mtuValue); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool Sync(string source, string destination) { var args = CommonString.Append(optionaHA, source, " ", destination); CommonProcess.Do(rsyncFileLocation, args); return(true); }
public static bool AddMultipathRoute(string networkAdapter, string secondNetworkAdapter) { var args = CommonString.Append("route add default scope global nexthop dev ", networkAdapter, " dev ", secondNetworkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool MakePartition(string diskPath, string partitionName, string partitionType, string partitionStart, string partitionEnd) { var args = CommonString.Append(diskPath, " -a optimal mkpart ", partitionName, " ", partitionType, " ", partitionStart, " ", partitionEnd); CommonProcess.Do(partedLocation, args); return(true); }
public static bool AddNetworkAdapted(string networkAdapter, string type) { var args = CommonString.Append("link add name ", networkAdapter, " type ", type); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool MakeLabel(string diskPath, string labelType) { var args = CommonString.Append(diskPath, " -a optimal mklabel ", labelType); CommonProcess.Do(partedLocation, args); return(true); }
public static bool DeleteRoute(string networkAdapter, string gateway, string destinationAddress = "default") { var args = CommonString.Append("route del ", destinationAddress, " via ", gateway, " dev ", networkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool Set() { var current = Application.CurrentConfiguration.SetupCommands; if (current == null) { return(false); } var setupLines = new string[current.Length]; for (var i = 0; i < current.Length; i++) { var setupCommand = current[i]; var exe = true; if (!string.IsNullOrEmpty(setupCommand.ControlBashCommand) && !string.IsNullOrEmpty(setupCommand.ControlResult)) { var setupCheckResult = CommonProcess.Execute(bashFileLocation, SetBahArguments(setupCommand.ControlBashCommand)); if (setupCheckResult.Any(_ => _.Contains(setupCommand.ControlResult))) { exe = false; } } if (exe) { ConsoleLogger.Log($"[setup] {setupCommand.BashCommand}"); CommonProcess.Do(bashFileLocation, SetBahArguments(setupCommand.BashCommand)); } setupLines[i] = setupCommand.BashCommand; } //File.WriteAllLines($"{Parameter.AntdCfgSetup}/{setupFilename}", setupLines); return(true); }
public static bool DisableNetworkAdapter(string networkAdapter) { var args = CommonString.Append("link set ", networkAdapter, " down"); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool AddAddress(string networkAdapter, string address, string range) { var args = CommonString.Append("addr add ", address, "/", range, " dev ", networkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool SetDeployment(string deployment) { var args = CommonString.Append(setDeploymentArg, " ", deployment); CommonProcess.Do(hostnamectlFileLocation, args); return(true); }
public static bool FlushNetworkAdapter(string networkAdapter) { var args = CommonString.Append("addr flush dev ", networkAdapter); CommonProcess.Do(ipFileLocation, args); return(true); }
public static bool DeleteNetworkAdapter(string bondName, string networkAdapter) { var args = CommonString.Append("-d ", bondName, " ", networkAdapter); CommonProcess.Do(ifenslaveFileLocation, args); return(true); }
public static bool Remove(string bridge) { var args = CommonString.Append(delbrArg, " ", bridge); CommonProcess.Do(brctlFileLocation, args); return(true); }