summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2019-11-01 08:22:39 -0500
committerJason Reiss <jreiss@multitech.com>2019-11-01 08:22:39 -0500
commit891853489f5e55c28f3fae401542fa1ab2a9dddc (patch)
treec542abfedb18e95659548fb606e9d1967175860b
parent3160bf3a91d042d00441c77db32be6f51b7100e2 (diff)
downloadlora-query-891853489f5e55c28f3fae401542fa1ab2a9dddc.tar.gz
lora-query-891853489f5e55c28f3fae401542fa1ab2a9dddc.tar.bz2
lora-query-891853489f5e55c28f3fae401542fa1ab2a9dddc.zip
Add short circuit if LNS is not listening on port 66771.0.5
-rw-r--r--main.cpp6
1 files changed, 5 insertions, 1 deletions
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;