14 lines
295 B
Bash
Executable File
14 lines
295 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
iwctl=(iwctl station wlan0)
|
|
|
|
"${iwctl[@]}" show | grep -q 'Scanning\s\+yes' || "${iwctl[@]}" scan
|
|
|
|
for _ in {0..29}; do
|
|
if "${iwctl[@]}" show | grep -q '\s*State\s\+connected\s*$'; then
|
|
kill -36 "$(cat "$HOME/.cache/pidofbar")"
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
done
|