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 29, 2024
1 parent b9ad688 commit 513513f
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 513513f

Please sign in to comment.