24 lines
362 B
Bash
Executable File
24 lines
362 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
|
|
if [[ $UID != 0 ]]; then
|
|
echo "This script needs to be executes as root"
|
|
exit 13
|
|
fi
|
|
|
|
BASEPATH=$(dirname `readlink -f "$0"`)
|
|
|
|
|
|
# Make BT discoverable:
|
|
sudo bluetoothctl <<EOF
|
|
power on
|
|
agent off
|
|
agent NoInputNoOutput
|
|
default-agent
|
|
discoverable on
|
|
pairable on
|
|
EOF
|
|
|
|
# Start bt-agent
|
|
sudo bt-agent --capability=DisplayOnly -p $BASEPATH/bt-pins
|