parent
f057593692
commit
13b29f7139
4 changed files with 46 additions and 0 deletions
@ -0,0 +1 @@ |
||||
ALL ALL=NOPASSWD: /usr/bin/sxmo_wifitoggle.sh |
@ -0,0 +1,38 @@ |
||||
#!/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 |
Loading…
Reference in new issue