summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli
diff options
context:
space:
mode:
Diffstat (limited to 'mullvad-cli')
-rw-r--r--mullvad-cli/src/cmds/debug.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/mullvad-cli/src/cmds/debug.rs b/mullvad-cli/src/cmds/debug.rs
index d67194b058..933f1212e8 100644
--- a/mullvad-cli/src/cmds/debug.rs
+++ b/mullvad-cli/src/cmds/debug.rs
@@ -9,6 +9,19 @@ use mullvad_types::{
pub enum DebugCommands {
/// Block all internet connection by setting an invalid relay constraint.
BlockConnection,
+ /// Relay
+ #[clap(subcommand)]
+ Relay(RelayDebugCommands),
+}
+
+#[derive(clap::Subcommand, Debug)]
+pub enum RelayDebugCommands {
+ /// Inactivate this _category of relays_ - a category can be one of the following: a relay, a
+ /// city, a country or a tunnel protocol (`openvpn` or `wireguard`).
+ Disable { relay: String },
+ /// (Re)Activate this _category of relays_ - a category can be one of the following: a relay, a
+ /// city, a country or a tunnel protocol (`openvpn` or `wireguard`).
+ Enable { relay: String },
}
impl DebugCommands {
@@ -41,6 +54,18 @@ impl DebugCommands {
eprintln!("WARNING: ENTERED BLOCKED MODE");
Ok(())
}
+ DebugCommands::Relay(RelayDebugCommands::Disable { relay }) => {
+ let mut rpc = MullvadProxyClient::new().await?;
+ rpc.disable_relay(relay.clone()).await?;
+ println!("{relay} is now marked as inactive");
+ Ok(())
+ }
+ DebugCommands::Relay(RelayDebugCommands::Enable { relay }) => {
+ let mut rpc = MullvadProxyClient::new().await?;
+ rpc.enable_relay(relay.clone()).await?;
+ println!("{relay} is now marked as active");
+ Ok(())
+ }
}
}
}