Skip to content

Commit

Permalink
Update IpController.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Jan 1, 2024
1 parent e9ed83e commit 38601e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion IPTables.Net/IpUtils/Utils/IpController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ protected virtual IpObject ParseObject(string str, string firstKey, char[] first

protected string[] Command(string command, params string[] args)
{
var cmd = string.Format("{0} {1} {2}", _module, command, string.Join(" ", args));
var cmd = $"{_module} {command} {string.Join(" ", args)}";
using (var process = _system.StartProcess("ip", cmd.TrimEnd()))
{
string output, error;
ProcessHelper.ReadToEnd(process, out output, out error);
Console.WriteLine(cmd);
Console.WriteLine("output" + output);
Console.WriteLine("error" + error);
return new string[] {output.Trim(), error.Trim()};
}
}
Expand Down

0 comments on commit 38601e6

Please sign in to comment.