mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-28 04:18:58 +03:00
19 lines
465 B
Bash
19 lines
465 B
Bash
#!/bin/bash
|
|||
|
|
# Exit 0 when FRIGATE_ROOT_SERVICES names the given service. Membership only:
|
||
|
|
# the euid and FRIGATE_RUN_AS_ROOT checks stay in the callers.
|
||
|
|
#
|
||
|
|
# Usage: service-runs-as-root SERVICE
|
||
|
|
|
||
|
|
set -o nounset
|
||
|
|
|
||
|
|
service="${1:?usage: service-runs-as-root SERVICE}"
|
||
|
|
|
||
|
|
IFS=',' read -ra entries <<< "${FRIGATE_ROOT_SERVICES:-}"
|
||
|
|
for entry in "${entries[@]}"; do
|
||
|
|
entry="${entry//[[:space:]]/}"
|
||
|
|
if [[ "$entry" == "$service" ]]; then
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
exit 1
|