all.destroy command to remove all tunnels

This commit is contained in:
knaccc
2019-01-30 16:33:00 +00:00
parent e5c256ff8c
commit 066ae985c8
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -119,6 +119,10 @@ specified host and port. Returns the I2P b32 destination address for the server
`tunnel-control.sh socks.destroy <local port>`
#### Destroy all tunnels. Returns "OK"
`tunnel-control.sh all.destroy`
#### Start a SAM listener on port 7656. Returns "OK"
`tunnel-control.sh sam.create`
@@ -374,6 +374,15 @@ public class TunnelControl implements Runnable {
break;
}
case "all.destroy": {
tunnelList.getTunnelsCopyStream().forEach(t -> {
t.destroy();
tunnelList.removeTunnel(t);
});
out.println("OK");
break;
}
case "sam.create": {
String[] samArgs = new String[]{"sam.keys", "127.0.0.1", "7656", "i2cp.tcp.host=127.0.0.1", "i2cp.tcp.port=7654"};
I2PAppContext context = router.getContext();