Skip to content

Commit

Permalink
only chown if existing
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
  • Loading branch information
enoch85 committed Oct 14, 2022
1 parent 99b612a commit b048bb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions static/setup_secure_permissions_nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ then
fi

# Nextcloud datafolder
if [ -d "$NCDATA" ]
if [ -d "${NCDATA}" ]
then
# Always chown root dir
chown "${htuser}":"${htgroup}" "${NCDATA}"/
Expand All @@ -83,7 +83,10 @@ then
chown -R "${htuser}":"${htgroup}" "${NCDATA}"/
fi
# Also always chown files_external (https://github.com/nextcloud/vm/issues/2398)
chown -R "${htuser}":"${htgroup}" "${NCDATA}"/files_external
if [ -d "${NCDATA}"/files_external ]
then
chown -R "${htuser}":"${htgroup}" "${NCDATA}"/files_external
fi
fi

chmod +x "${NCPATH}"/occ
Expand Down

0 comments on commit b048bb5

Please sign in to comment.