Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

check wifi before ssh

Geof8c4ac078259
diff --git a/src/Controllers/WifiController.cpp b/src/Controllers/WifiController.cpp
index 15853b36..7adfeb77 100644
--- a/src/Controllers/WifiController.cpp
+++ b/src/Controllers/WifiController.cpp
@@ -281,6 +281,12 @@ void WifiController::handleWebUi(const TerminalCommand&) {
SSH
*/
void WifiController::handleSsh(const TerminalCommand& cmd) {
+ // Check connection
+ if (!wifiService.isConnected()) {
+ terminalView.println("SSH: You must be connected to Wi-Fi. Use 'connect' first.");
+ return;
+ }
+
// Check args
auto args = argTransformer.splitArgs(cmd.getArgs());
if (cmd.getSubcommand().empty() || args.size() < 2) {