From d3f46cbd102c7be5a4dd930b63eae47e9f003f65 Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Fri, 11 Aug 2017 21:49:34 -0500 Subject: [PATCH] Quick fix for scanner output width auto-adjust. --- fluxion.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fluxion.sh b/fluxion.sh index 37b9dee..0789570 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -727,9 +727,12 @@ function set_target_ap() { fi done - # Todo: WiFi scanner bug here, spacing is off when dealing with large fields. - local header=$(printf "%44s\n\n$CRed[$CYel * $CRed]$CClr %-30s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "SSID" "QLTY" "PWR" "CL" "CH" "SEC" "MAC ADDRESS") - io_query_format_fields "$header" "$CRed[$CYel%03d$CRed]%b %-30s %3s%% %3s %3d %4s %6s %18s\n" \ + local bashWidth=$(tput cols) + local ssidWidth=$(($bashWidth - 51)) + local headWidth=$(($bashWidth / 2 + 4)) + + local header=$(printf "%${headWidth}s\n\n$CRed[$CYel * $CRed]$CClr %-${ssidWidth}s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "SSID" "QLTY" "PWR" "CL" "CH" "SEC" "MAC ADDRESS") + io_query_format_fields "$header" "$CRed[$CYel%03d$CRed]%b %-${ssidWidth}s %3s%% %3s %3d %4s %6s %18s\n" \ TargetAPCandidatesColor[@] \ TargetAPCandidatesESSID[@] \ TargetAPCandidatesQuality[@] \