You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
557 B

#!/usr/bin/env sh
# Note: this script should be run as root via sudo
[ -n "$WLAN_MODULE" ] || WLAN_MODULE="8723cs"
on() {
if lsmod | grep -qE "$WLAN_MODULE"; then
rfkill unblock wlan
else
modprobe "$WLAN_MODULE" && rfkill unblock wlan
fi
}
off() {
if lsmod | grep -qE "$WLAN_MODULE"; then
rfkill block wlan && rmmod "$WLAN_MODULE"
else
rfkill block wlan
fi
}
case "$1" in
on)
on
;;
off)
off
;;
*) #toggle
if rfkill -rn | grep wlan | grep -qE "unblocked unblocked"; then
off
else
on
fi
esac
sxmo_statusbarupdate.sh