Skip to content

Commit a36deff

Browse files
authored
fix(enhancement): ensure correct ownership check before setting permissions of profiles (#3855)
1 parent d576137 commit a36deff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

install/ensure-correct-permissions-profiles-dir.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
echo "${_group}Ensuring correct permissions on profiles directory ..."
66

7-
$dcr --no-deps --entrypoint /bin/bash --user root vroom -c 'chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles'
7+
# Check if the parent directory of /var/vroom/sentry-profiles is already owned by vroom:vroom
8+
if [ "$(stat -c '%U:%G' /var/vroom)" = "vroom:vroom" ]; then
9+
echo "Ownership of /var/vroom is already set to vroom:vroom. Skipping chown."
10+
else
11+
$dcr --no-deps --entrypoint /bin/bash --user root vroom -c 'chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles'
12+
fi
813

914
echo "${_endgroup}"

0 commit comments

Comments
 (0)