Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert negative signal to sort on 6.1 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions wiconfig
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function scan {
# IFS=' "'
# IFS=$oIFS
echo -n > "$output"
typeset _nwids _args _nwid
typeset _nwids _args _nwid _signal

! $quiet && echo "Performing wireless scan..."
# Parse ifconfig nwid output for sorting
Expand Down Expand Up @@ -266,7 +266,10 @@ function scan {
# MAC
echo -n "|$4" >> $output
# Signal quality
printf "|%02d" ${5%dBm} >> $output
_signal=${5%dBm} # Remove dBm suffix
_signal=${_signal%\%} # Remove % suffix
_signal=${_signal#-} # Make signal always positive
printf "|%02d" ${_signal} >> $output
# Speed
echo -n "|$6" >> $output
# Options
Expand Down Expand Up @@ -379,7 +382,7 @@ function menu {
echo
for _i in ${index[@]}; do
printf "%3d) %-40s %-6s %-10s\n" \
$_i "${nwid[$_i]}" "${db[$_i]}dB" "${access[$_i]}"
$_i "${nwid[$_i]}" "${db[$_i]}" "${access[$_i]}"
done
echo
read choice?"Enter the number of the network to connect to (or r to rescan or q to quit): "
Expand Down