|
|
|
@ -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
|
|
|
|
|