From 8c3383e01d8cca8124115aa1907c263e6a8de057 Mon Sep 17 00:00:00 2001 From: konrad Date: Thu, 29 Nov 2018 01:08:17 +0100 Subject: [PATCH] Fixed lint etc --- pkg/config/config.go | 17 ++++++++++++----- pkg/processing/run_airodump.go | 2 +- pkg/processing/update_active_clients.go | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index d1eec2a..3fe8b7c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -17,8 +17,15 @@ package config -const TheClientCSVHeader = `Station MAC, First time seen, Last time seen, Power, # packets, BSSID, Probed ESSIDs` -const CSVDumps = `/home/konrad/go/src/git.kolaente.de/sofaraum/client` -const SecondsUntilInactive = 120 -const UpdateSecondsInterval = 2 -const WifiInterface = `wlp59s0` +const ( + // TheClientCSVHeader is the header of the csv file where aircrack-ng starts putting infos about the clients + TheClientCSVHeader = `Station MAC, First time seen, Last time seen, Power, # packets, BSSID, Probed ESSIDs` + // CSVDumps is the folder where aircrack-ng stores the dumps + CSVDumps = `/home/konrad/go/src/git.kolaente.de/sofaraum/client` + // SecondsUntilInactive specifies the seconds until a client is considered inactive + SecondsUntilInactive = 120 + // UpdateSecondsInterval is how often the currently active clients should be processed and sent to the server + UpdateSecondsInterval = 2 + // WifiInterface the wifi interface aircrack-ng listens on + WifiInterface = `wlp59s0` +) diff --git a/pkg/processing/run_airodump.go b/pkg/processing/run_airodump.go index ddcf6a6..89ea470 100644 --- a/pkg/processing/run_airodump.go +++ b/pkg/processing/run_airodump.go @@ -27,7 +27,7 @@ import ( func RunAirodumpNG(stop chan int) { 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 sufficent permissions. ", err) + log.Println("Could not run airodump-ng. Please make sure it is installed and you have sufficient permissions. ", err) stop <- 1 } } diff --git a/pkg/processing/update_active_clients.go b/pkg/processing/update_active_clients.go index 7b6c7f6..63681c5 100644 --- a/pkg/processing/update_active_clients.go +++ b/pkg/processing/update_active_clients.go @@ -23,6 +23,7 @@ import ( "time" ) +// UpdateActiveClients counts all clients and sends the number to the server. Meant to run inside a goroutine. func UpdateActiveClients() { for { time.Sleep(config.UpdateSecondsInterval * time.Second)