Skip to content

Commit

Permalink
Remove first line from init output (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfs committed Apr 23, 2019
1 parent a34de73 commit 8339c66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/Collectors/Service/ServiceCollector.cs
Expand Up @@ -169,8 +169,7 @@ public override void Execute()
var result = runner.RunExternalCommand("systemctl", "list-units --type service");

//Split lines and remove header
var lines = result.Split('\n');
lines.ToList().RemoveAt(0);
var lines = result.Split('\n').Skip(1);

foreach (var _line in lines)
{
Expand All @@ -192,7 +191,7 @@ public override void Execute()

result = runner.RunExternalCommand("ls", "/etc/init.d/ -l");

lines = result.Split('\n');
lines = result.Split('\n').Skip(1);
String pattern = @".*\s(.*)";

foreach (var _line in lines)
Expand Down

0 comments on commit 8339c66

Please sign in to comment.