Skip to content

Commit

Permalink
Works now
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Apr 17, 2016
1 parent 26b8e77 commit 966b993
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var format2 = logging.MustStringFormatter(
)

var verbose = true
var errorsInARow = 0

func getInput(prompt string) string {
reader := bufio.NewReader(os.Stdin)
Expand Down Expand Up @@ -214,11 +215,20 @@ func main() {
if strings.Contains(err.Error(), "255") {
fmt.Println("\nNeed to run with sudo: 'sudo ./fingerprint'")
fmt.Println("")
log.Fatal(string(out), err)
} else {
log.Critical("Are you sure this computer has WiFi enabled?")
errorsInARow++
log.Warning("Scan failed, will continue after a rest")
time.Sleep(3000 * time.Millisecond)
if errorsInARow > 3 {
log.Critical("Are you sure this computer has WiFi enabled?")
log.Fatal(string(out), err)
} else {
continue
}
}
log.Fatal(string(out), err)
}
errorsInARow = 0

log.Info("Processing", len(strings.Split(out, "\n")), "lines out output")
f.WifiFingerprint, err = processOutput(out, runtime.GOOS)
Expand Down

0 comments on commit 966b993

Please sign in to comment.