Update and rename wifi.sh to wifi-bt.sh
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
wifi)
|
||||||
|
WIFI_STATUS=$(nmcli radio wifi)
|
||||||
|
|
||||||
|
if [ "$WIFI_STATUS" = "enabled" ]; then
|
||||||
|
# Wi-Fi KAPAT
|
||||||
|
nmcli radio wifi off
|
||||||
|
pkill nm-applet
|
||||||
|
else
|
||||||
|
# Wi-Fi AÇ
|
||||||
|
nmcli radio wifi on
|
||||||
|
sleep 0.3
|
||||||
|
nm-applet &
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bluetooth|bt)
|
||||||
|
BT_STATUS=$(bluetoothctl show | grep "Powered:" | awk '{pr>
|
||||||
|
|
||||||
|
if [ "$BT_STATUS" = "yes" ]; then
|
||||||
|
# Bluetooth KAPAT
|
||||||
|
bluetoothctl power off
|
||||||
|
pkill blueman-applet
|
||||||
|
else
|
||||||
|
# Bluetooth AÇ
|
||||||
|
bluetoothctl power on
|
||||||
|
blueman-manager &
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
STATUS=$(nmcli radio wifi)
|
|
||||||
|
|
||||||
if [ "$STATUS" = "enabled" ]; then
|
|
||||||
# Wi-Fi KAPAT
|
|
||||||
nmcli radio wifi off
|
|
||||||
pkill nm-applet
|
|
||||||
else
|
|
||||||
# Wi-Fi AÇ
|
|
||||||
nmcli radio wifi on
|
|
||||||
nm-applet &
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user