fix: only rsync existing directories
Additionally, pin the chown to just the top-level dir for the services dir
This commit is contained in:
@@ -41,13 +41,15 @@ main() {
|
|||||||
if [[ ! -e "$dir" ]]; then
|
if [[ ! -e "$dir" ]]; then
|
||||||
log-info "Copying ${dir} skel into place"
|
log-info "Copying ${dir} skel into place"
|
||||||
mkdir -p "/mnt/dokku${dir}"
|
mkdir -p "/mnt/dokku${dir}"
|
||||||
if [[ -d "$dir" ]]; then
|
if [[ -d "/skel${dir}" ]]; then
|
||||||
rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place"
|
rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# chown mount directories to "dokku:dokku"
|
# chown mount directories to "dokku:dokku"
|
||||||
if [[ "$dir" != "/etc/ssh" ]]; then
|
if [[ "$dir" == "/var/lib/dokku/services" ]]; then
|
||||||
|
chown dokku:dokku /var/lib/dokku/services
|
||||||
|
elif [[ "$dir" != "/etc/ssh" ]]; then
|
||||||
find "$dir" -print0 | xargs -0 chown -h dokku:dokku
|
find "$dir" -print0 | xargs -0 chown -h dokku:dokku
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user