fix permissions for /dev/dvb

This commit is contained in:
aptalca 2019-07-10 16:47:54 -04:00 committed by Ryan Kuba
parent 8decc2cae8
commit 2dc0521c2c
3 changed files with 10 additions and 4 deletions

View file

@ -1,9 +1,13 @@
#!/usr/bin/with-contenv bash
# check for the existence of a video device
if [ -e /dev/dri ]; then
VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1)
# just add abc to root if stuff in dri is root owned
# check for the existence of a video and/or tuner device
if [ -e /dev/dri ] || [ -e /dev/dvb ]; then
if [ -e /dev/dri ]; then
VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1)
else
VIDEO_GID=$(stat -c '%g' /dev/dvb/* | grep -v '^0$' | head -n 1)
fi
# just add abc to root if stuff in dri/dvb is root owned
if [ -z "${VIDEO_GID}" ]; then
usermod -a -G root abc
exit 0