Fixing perseususb group issue.

This commit is contained in:
Marat Fayzullin 2024-02-05 16:25:23 -05:00
parent 774fc133da
commit 8605a8e89f
1 changed files with 4 additions and 2 deletions

View File

@ -14,8 +14,10 @@ case "$1" in
adduser --system --group --no-create-home --home /nonexistent --quiet "${OWRX_USER}"
usermod -aG plugdev "${OWRX_USER}"
# ensure group exists first (dependency is optional)
addgroup --system --quiet perseususb
# addgroup will error out if the group exists, but is not a system group. it doesn't matter for the intended purpose, but we need extra protection for this case.
if [ ! $(getent group perseususb) ]; then
addgroup --system --quiet perseususb
fi
usermod -aG perseususb "${OWRX_USER}"
# create OpenWebRX data directory and set the correct permissions