File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 15
15
for i in $FILES
16
16
do
17
17
VIDEO_GID=$(stat -c '%g' "$i")
18
- if ! id -G abc | grep -qw "$VIDEO_GID"; then
19
- if [ "${VIDEO_GID}" == '0' ]; then
20
- usermod -a -G root abc
21
- else
18
+ if id -G abc | grep -qw "$VIDEO_GID"; then
19
+ touch /groupadd
20
+ else
21
+ if [ ! "${VIDEO_GID}" == '0' ]; then
22
22
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
23
23
if [ -z "${VIDEO_NAME}" ]; then
24
24
VIDEO_NAME="video$(head /dev/urandom | tr -dc 0-9 | head -c4)"
25
25
groupadd "$VIDEO_NAME"
26
26
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
27
27
fi
28
28
usermod -a -G "$VIDEO_NAME" abc
29
+ touch /groupadd
29
30
fi
30
31
fi
31
- done
32
+ done
33
+
34
+ if [ ! -z "${FILES}" ] && [ ! -f "/groupadd" ]; then
35
+ usermod -a -G root abc
36
+ fi
You can’t perform that action at this time.
0 commit comments