Skip to content

Commit b01cd52

Browse files
committed
optmizations from @nemchik
1 parent 177088c commit b01cd52

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

root/etc/cont-init.d/50-gid-video

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
# check for the existence of a video and/or tuner device
4-
if [ -e /dev/dri ] || [ -e /dev/dvb ]; then
5-
if [ -e /dev/dri ]; then
6-
FILES="${FILES} /dev/dri/*"
7-
fi
8-
if [ -e /dev/dvb ]; then
9-
FILES="${FILES} /dev/dvb/*"
10-
fi
11-
else
12-
exit 0
13-
fi
3+
FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null)
144

155
for i in $FILES
166
do
@@ -31,6 +21,6 @@ do
3121
fi
3222
done
3323

34-
if [ ! -z "${FILES}" ] && [ ! -f "/groupadd" ]; then
24+
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then
3525
usermod -a -G root abc
3626
fi

0 commit comments

Comments
 (0)