#!/bin/bash . lib/common set -e uid_gid=$(get_service_base_image_dir_uid_gid "$MASTER_TARGET_SERVICE_NAME" /var/www/html) || { err "Could not determine uid:gid for $MASTER_TARGET_SERVICE_NAME of dir /var/www/html" exit 1 } gid="${uid_gid#* }" dirs=( /var/tmp/opensem/media-library /var/cache/opensem/bootstrap /var/cache/opensem/framework /var/cache/opensem/views /var/lib/opensem/sessions /var/lib/opensem/app /var/lib/opensem/app/public /var/log/opensem ) to_create=() volumes="" for d in "${dirs[@]}"; do fdir="${SERVICE_DATASTORE}$d" if [ -d "$fdir" ]; then find "$fdir" \! -gid "$gid" -print0 | while read-0 f; do chgrp -v "$gid" "$f" || return 1 done find "$fdir" \! -perm -g+rwx -print0 | while read-0 f; do chmod -v g+rwx "$f" || return 1 done else to_create+=("$fdir") fi done if [ "${#to_create[@]}" -gt 0 ]; then mkdir -p "${to_create[@]}" || return 1 chgrp -v "${gid}" "${to_create[@]}" || return 1 chmod g+rwx "${to_create[@]}" || return 1 fi dev=$(options-get dev 2>/dev/null) || true if [ -n "$dev" ]; then # if ! [ -d "$dev" ]; then # err "The 'dev' option is set to '$dev' but this is not a directory." # exit 1 # fi OPENSEM_CODE="$dev" fi service:docker-compose:directive-merge "$MASTER_TARGET_SERVICE_NAME" <