From d0679ce785ae7c05d85cfcbd8933d5e2088d191f Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 2 Dec 2018 01:53:54 +0100 Subject: [PATCH] made stop a bool channel --- main.go | 6 +++--- pkg/processing/run_airodump.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 2fb7fa3..f9ae950 100644 --- a/main.go +++ b/main.go @@ -49,15 +49,15 @@ func main() { to redistribute it under certain conditions =================================================`) - stop := make(chan int) + stop := make(chan bool) go processing.RunAirodumpNG(stop) go processing.UpdateActiveClients() for exit := range stop { - if exit == 0 { + if !exit { continue } - os.Exit(exit) + os.Exit(1) } } diff --git a/pkg/processing/run_airodump.go b/pkg/processing/run_airodump.go index 89ea470..a3fb253 100644 --- a/pkg/processing/run_airodump.go +++ b/pkg/processing/run_airodump.go @@ -24,10 +24,10 @@ import ( ) // RunAirodumpNG does what it says -func RunAirodumpNG(stop chan int) { +func RunAirodumpNG(stop chan bool) { err := exec.Command("/bin/bash", []string{"-c", "airodump-ng " + config.WifiInterface + " -w " + config.CSVDumps + "/dump --output-format csv"}...).Run() if err != nil { log.Println("Could not run airodump-ng. Please make sure it is installed and you have sufficient permissions. ", err) - stop <- 1 + stop <- true } }