From 891853489f5e55c28f3fae401542fa1ab2a9dddc Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Fri, 1 Nov 2019 08:22:39 -0500 Subject: Add short circuit if LNS is not listening on port 6677 --- main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 78f5c77..756444f 100644 --- a/main.cpp +++ b/main.cpp @@ -118,7 +118,7 @@ int main(int argc, char**argv) { if (opt_stats_reset) { runCmd(cmd_stats_reset); } - + if (opt_command) { std::stringstream cmd; @@ -229,6 +229,10 @@ void runCmd(const char *command) { receiveStream.str(""); receiveStream.clear(); + if (system("netstat -lanu | grep \":6677 \"")) { + return; + } + if (NULL == command) { printError("Command is null\n"); return; -- cgit v1.2.3