mirror of
https://github.com/linuxserver/docker-jellyfin.git
synced 2025-10-26 18:53:39 +09:00
improve vide gid fix
This commit is contained in:
@@ -5,29 +5,20 @@ FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/video1? -type c -print 2>/dev/nul
|
|||||||
for i in $FILES
|
for i in $FILES
|
||||||
do
|
do
|
||||||
VIDEO_GID=$(stat -c '%g' "$i")
|
VIDEO_GID=$(stat -c '%g' "$i")
|
||||||
if id -G abc | grep -qw "$VIDEO_GID"; then
|
if ! id -G abc | grep -qw "$VIDEO_GID"; then
|
||||||
touch /groupadd
|
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
|
||||||
else
|
if [ -z "${VIDEO_NAME}" ]; then
|
||||||
if [ ! "${VIDEO_GID}" == '0' ]; then
|
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
|
||||||
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
|
groupadd "$VIDEO_NAME"
|
||||||
if [ -z "${VIDEO_NAME}" ]; then
|
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
|
||||||
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
|
|
||||||
groupadd "$VIDEO_NAME"
|
|
||||||
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
|
|
||||||
fi
|
|
||||||
usermod -a -G "$VIDEO_NAME" abc
|
|
||||||
touch /groupadd
|
|
||||||
fi
|
fi
|
||||||
|
usermod -a -G "$VIDEO_NAME" abc
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then
|
|
||||||
usermod -a -G root abc
|
|
||||||
fi
|
|
||||||
|
|
||||||
# openmax lib loading
|
# openmax lib loading
|
||||||
if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
|
if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
|
||||||
echo "[jellyfin-init] Pi Libs detected loading"
|
echo "[jellyfin-init] Pi Libs detected loading"
|
||||||
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
|
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
|
||||||
ldconfig
|
ldconfig
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user