From 762141efbf414bc05b3a3b3bfd00f3c8cc17557e Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Sat, 25 Jul 2020 11:12:56 +0900 Subject: [PATCH] setcap.sh: Add helper script to set bluepy-helper capability To avoid sudo for scratch_link.py, it is required to set capability to bluepy-helper executable so that normal users can connect to BLE devices through bluepy. To simplify the command line to do this, add the helper script setcap.sh. Signed-off-by: Shin'ichiro Kawasaki --- setcap.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 setcap.sh diff --git a/setcap.sh b/setcap.sh new file mode 100755 index 0000000..df58ccf --- /dev/null +++ b/setcap.sh @@ -0,0 +1,6 @@ +#!/bin/sh +echo "Set up bluepy-helper capability to allow use by normal users" +find /usr -name bluepy-helper -exec sudo setcap \ + 'cap_net_raw,cap_net_admin+eip' {} \; 2> /dev/null +find /usr -name bluepy-helper -exec sudo getcap {} \; 2> /dev/null +