Skip to content
Permalink
Browse files

fixing set command

  • Loading branch information
jaredhaight committed Oct 20, 2019
1 parent 5ea2268 commit dd5fa6d53578e6680abe28ba6367990ada4163bb
Showing with 22 additions and 1 deletion.
  1. +22 −1 Handlers/ConsoleMessageEventHandler.cs
@@ -546,7 +546,28 @@ public async Task Handle(NewConsoleMessage newConsoleMessage, string replyTo, st
// * set beacon:5
else if (agentTask.Action == "SET")
{
outboundMessage.Add("Command", consoleMessageComponents[1]);
List<string> validSetCommands = new List<string> {"beaconinterval", "jitter"};
if (consoleMessageComponents.Length == 2)
{
if (validSetCommands.Any(validOption => consoleMessageComponents[1].ToLower().StartsWith(validOption)))
{
outboundMessage.Add("Command", consoleMessageComponents[1]);
}
else
{
error = true;
errorMessage = $"{consoleMessageComponents[1]} is not a valid option for set. The following SET options are valid: \n" +
$"* set BeaconInterval\n" +
$"* set Jitter\n";
}
}
else
{
error = true;
errorMessage = $"The following SET options are valid: \n" +
$"* set BeaconInterval\n" +
$"* set Jitter\n";
}
}

else if (agentTask.Action == "EXIT")

0 comments on commit dd5fa6d

Please sign in to comment.
You can’t perform that action at this time.