new script to reconnect to best wifi network
This commit is contained in:
parent
0a744117a4
commit
3e1407c30b
|
@ -29,6 +29,7 @@ resholve.mkDerivation {
|
|||
ifuse
|
||||
inetutils
|
||||
inotify-tools
|
||||
iwd
|
||||
ncurses
|
||||
oath-toolkit
|
||||
openssh
|
||||
|
@ -66,6 +67,7 @@ resholve.mkDerivation {
|
|||
"cannot:${duplicity}/bin/duplicity"
|
||||
"cannot:${gocryptfs}/bin/gocryptfs"
|
||||
"cannot:${ifuse}/bin/ifuse"
|
||||
"cannot:${iwd}/bin/iwctl"
|
||||
"cannot:${oath-toolkit}/bin/oathtool"
|
||||
"cannot:${openssh}/bin/ssh-keygen"
|
||||
"cannot:${rmlint}/bin/rmlint"
|
||||
|
|
12
pkgs/sane-scripts/src/sane-ip-reconnect
Executable file
12
pkgs/sane-scripts/src/sane-ip-reconnect
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# reconnect to best wifi network.
|
||||
# lappy frequently DCs from the ideal network
|
||||
|
||||
set -ex
|
||||
|
||||
sudo iwctl station wlan0 scan
|
||||
sleep 5
|
||||
# get networks. remove control characters (colors), then leading info, then take the top-rated network
|
||||
netname=$(iwctl station wlan0 get-networks | sed 's/\[[0-9;]*m//g' | sed 's/^ [ >]*//g' | sed -n 5p | cut -d' ' -f 1)
|
||||
sudo iwctl station wlan0 connect "$netname"
|
Loading…
Reference in New Issue
Block a user