Update wifi-bt.sh
This commit is contained in:
@@ -5,11 +5,9 @@ case "$1" in
|
|||||||
WIFI_STATUS=$(nmcli radio wifi)
|
WIFI_STATUS=$(nmcli radio wifi)
|
||||||
|
|
||||||
if [ "$WIFI_STATUS" = "enabled" ]; then
|
if [ "$WIFI_STATUS" = "enabled" ]; then
|
||||||
# Wi-Fi KAPAT
|
|
||||||
nmcli radio wifi off
|
nmcli radio wifi off
|
||||||
pkill nm-applet
|
pkill nm-applet
|
||||||
else
|
else
|
||||||
# Wi-Fi AÇ
|
|
||||||
nmcli radio wifi on
|
nmcli radio wifi on
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
nm-applet &
|
nm-applet &
|
||||||
@@ -17,16 +15,12 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
bluetooth|bt)
|
bluetooth|bt)
|
||||||
BT_STATUS=$(bluetoothctl show | grep "Powered:" | awk '{pr>
|
BT_STATUS=$(bluetoothctl show | awk '/Powered:/ {print $2}')
|
||||||
|
|
||||||
if [ "$BT_STATUS" = "yes" ]; then
|
if [ "$BT_STATUS" = "yes" ]; then
|
||||||
# Bluetooth KAPAT
|
|
||||||
bluetoothctl power off
|
bluetoothctl power off
|
||||||
pkill blueman-applet
|
|
||||||
else
|
else
|
||||||
# Bluetooth AÇ
|
|
||||||
bluetoothctl power on
|
bluetoothctl power on
|
||||||
blueman-manager &
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user