Skip to content

Commit

Permalink
WhonixTorController: Implement SETCONF command
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed May 22, 2024
1 parent 93f7484 commit c7dd2c0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ public void resetConf(String configName) throws IOException {
}
}

public void setConfig(String configName, String configValue) throws IOException {
String command = "SETCONF " + configName + "=" + configValue + "\r\n";
sendCommand(command);
String reply = receiveReply();
if (!reply.equals("250 OK")) {
throw new ControlCommandFailedException("Couldn't set config: " + configName + "=" + configValue);
}
}

public void setEvents(List<String> events) throws IOException {
var stringBuilder = new StringBuffer("SETEVENTS");
events.forEach(event -> stringBuilder.append(" ").append(event));
Expand Down

0 comments on commit c7dd2c0

Please sign in to comment.