Read CAP_STR into an array and output one cap per line in startup

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2022-08-29 16:49:16 +01:00
parent 27980ed9cf
commit efd587bdd1
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ fix_capabilities() {
if [[ ${CAP_STR} ]]; then
# We have the (some of) the above caps available to us - apply them to pihole-FTL
echo " [i] Applying the following caps to pihole-FTL:"
echo " ${CAP_STR:1}"
IFS=',' read -ra CAPS <<< "${CAP_STR:1}"
for i in "${CAPS[@]}"; do
echo " * ${i}"
done
setcap ${CAP_STR:1}+ep "$(which pihole-FTL)" || ret=$?
if [[ $DHCP_READY == false ]] && [[ $DHCP_ACTIVE == true ]]; then