#!/bin/bash

# This grants the node binary cap_net_raw privileges, so it can start/stop BLE advertising.
setcap cap_net_raw+eip $(eval readlink -f `which node`)

# Power Bluetooth adapter up (after disabling bluetoothd, because BlueZ is installed)
systemctl disable bluetooth
hciconfig hci0 up