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)"
fi
groupadd "$VIDEO_NAME"
usermod -a -G "$VIDEO_NAME" abc
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then
fi
echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n"
usermod -a -G "$VIDEO_NAME" abc
fi
touch /groupadd
fi
fi
fi
done
done
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then