decrease chance of collision if we are setting multiple group names

pull/208/head
thelamer 5 years ago
parent baa34948d8
commit 177088c298

@ -21,7 +21,7 @@ do
if [ ! "${VIDEO_GID}" == '0' ]; then if [ ! "${VIDEO_GID}" == '0' ]; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 0-9 | head -c4)" VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
groupadd "$VIDEO_NAME" groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME" groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi fi
@ -33,4 +33,4 @@ done
if [ ! -z "${FILES}" ] && [ ! -f "/groupadd" ]; then if [ ! -z "${FILES}" ] && [ ! -f "/groupadd" ]; then
usermod -a -G root abc usermod -a -G root abc
fi fi

Loading…
Cancel
Save