Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ubuntu/16.04/usr/local/share/bootstrap/update_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ function update_permissions() {
CODE_OWNER="$APP_USER"
export APP_USER
export CODE_OWNER

if [[ "$group" = UNKNOWN ]]; then
APP_GROUP="$APP_USER"
CODE_GROUP="$APP_GROUP"
export APP_GROUP
export CODE_GROUP
groupadd --system --gid "$group_id" "$APP_GROUP" || groupmod -g "$group_id" "$APP_GROUP"
else
APP_GROUP="$group"
CODE_GROUP="$APP_GROUP"
export APP_GROUP
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s some duplication here that prI à my could have needed a small refactoring :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t update on mobile... but « prl à my » = « probably » 😅

export CODE_GROUP
fi
useradd --create-home --system --uid "$owner_id" --gid "$group_id" "$APP_USER" || usermod -u "$owner_id" "$APP_USER"
useradd --create-home --system --uid "$owner_id" --gid "$group_id" "$APP_USER" || usermod -u "$owner_id" -g "$APP_GROUP" "$APP_USER"
else
echo "The user $owner with ID $owner_id already exists in the container. Nothing to do."
fi
}