Skip to content

Commit 3664958

Browse files
authored
Merge pull request #467 from jacs-inviqa/feature/MISC-add-linux-compatible-permission-update
MISC Add linux compatible permission update.
2 parents 99b4daf + 0228765 commit 3664958

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ubuntu/16.04/usr/local/share/bootstrap/update_permissions.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ function update_permissions() {
2424
CODE_OWNER="$APP_USER"
2525
export APP_USER
2626
export CODE_OWNER
27-
2827
if [[ "$group" = UNKNOWN ]]; then
2928
APP_GROUP="$APP_USER"
3029
CODE_GROUP="$APP_GROUP"
3130
export APP_GROUP
3231
export CODE_GROUP
3332
groupadd --system --gid "$group_id" "$APP_GROUP" || groupmod -g "$group_id" "$APP_GROUP"
33+
else
34+
APP_GROUP="$group"
35+
CODE_GROUP="$APP_GROUP"
36+
export APP_GROUP
37+
export CODE_GROUP
3438
fi
35-
useradd --create-home --system --uid "$owner_id" --gid "$group_id" "$APP_USER" || usermod -u "$owner_id" "$APP_USER"
39+
useradd --create-home --system --uid "$owner_id" --gid "$group_id" "$APP_USER" || usermod -u "$owner_id" -g "$APP_GROUP" "$APP_USER"
40+
else
41+
echo "The user $owner with ID $owner_id already exists in the container. Nothing to do."
3642
fi
3743
}

0 commit comments

Comments
 (0)