20 lines
306 B
Bash
20 lines
306 B
Bash
#!/usr/bin/env bash
|
|
is_active() {
|
|
rfkill list wifi 2>/dev/null | grep -q "Soft blocked: yes"
|
|
}
|
|
|
|
case "$1" in
|
|
status)
|
|
is_active && echo true || echo false
|
|
;;
|
|
*)
|
|
if is_active; then
|
|
rfkill unblock all
|
|
echo false
|
|
else
|
|
rfkill block all
|
|
echo true
|
|
fi
|
|
;;
|
|
esac
|