3 # Released under the GPL
5 INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
7 if [ ${1} = "startup" ]; then
8 [ -f ~/.op_btenabled ] && sudo /usr/sbin/hciconfig ${INTERFACE} up pscan && sudo /usr/sbin/bluetoothd ||echo "Bluetooth: User has not enabled Bluetooth."
11 # Figure out if Bluetooth is running or not
13 if [ "`hciconfig ${INTERFACE} | grep UP`" ]
15 notify-send -u normal "Bluetooth" "Bluetooth is being disabled..." -i /usr/share/icons/hicolor/32x32/apps/blueman.png
16 sudo /usr/sbin/hciconfig ${INTERFACE} down
17 sudo killall btaddconn
18 sudo killall btdelconn
24 notify-send -u normal "Bluetooth" "Bluetooth is being enabled..." -i /usr/share/icons/hicolor/32x32/apps/blueman.png
25 sudo /usr/sbin/hciconfig ${INTERFACE} down
26 sudo /usr/sbin/hciconfig ${INTERFACE} up pscan
27 sudo /usr/sbin/bluetoothd
29 echo true > ~/.op_btenabled