diff options
author | Daniel Hansson <mailto@danielhansson.nu> | 2022-10-14 11:52:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 11:52:56 +0300 |
commit | b048bb5ecde60bed989087c995045ef5192fb6b7 (patch) | |
tree | 0bb9b3b2c00122a5ec94d939b6e573202127ca8e | |
parent | 99b612a3a4d1fc069be5230fd179e99f25d27c26 (diff) |
only chown if existing
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
-rw-r--r-- | static/setup_secure_permissions_nextcloud.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/static/setup_secure_permissions_nextcloud.sh b/static/setup_secure_permissions_nextcloud.sh index 80309d09..fdbb24f8 100644 --- a/static/setup_secure_permissions_nextcloud.sh +++ b/static/setup_secure_permissions_nextcloud.sh @@ -73,7 +73,7 @@ then fi # Nextcloud datafolder -if [ -d "$NCDATA" ] +if [ -d "${NCDATA}" ] then # Always chown root dir chown "${htuser}":"${htgroup}" "${NCDATA}"/ @@ -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 |