- bucketnames have to be lower case
- output from occ changed so --show-password is needed now
This commit is contained in:
parent
a68fea86b8
commit
83fcc67c91
2 changed files with 4 additions and 2 deletions
|
@ -43,9 +43,11 @@ for eppn in $(echo "${users}" | jq -r keys[]); do
|
|||
username=${eppn%@*}
|
||||
# Remove underscore from username
|
||||
user=${username//_/-}
|
||||
# convert user to lower case for bucket naming rules
|
||||
user_lower=${user,,}
|
||||
|
||||
echo "$(date) - Check bucket status for ${eppn}"
|
||||
bucketname="${user}-${site_name//./-}"
|
||||
bucketname="${user_lower}-${site_name//./-}"
|
||||
if ! echo "${buckets}" | grep "${bucketname}" &> /dev/null; then
|
||||
echo "$(date) - ${eppn} has no mounts configured, adding bucket and mounts..."
|
||||
${rclone} mkdir "${rcp}:${bucketname}"
|
||||
|
|
|
@ -33,7 +33,7 @@ fi
|
|||
key=$(grep access_key_id "${rclone_config}" | awk '{print $3}')
|
||||
secret=$(grep secret_access_key "${rclone_config}"| awk '{print $3}')
|
||||
endpoint=$(grep endpoint "${rclone_config}" | awk '{print $3}')
|
||||
preexisting="$(docker exec -u www-data -i "${container}" php --define apc.enable_cli=1 /var/www/html/occ files_external:list --output json "${user}" | jq -r '.[] | .configuration.bucket' | grep "${bucket}")"
|
||||
preexisting="$(docker exec -u www-data -i "${container}" php --define apc.enable_cli=1 /var/www/html/occ files_external:list --output json --show-password "${user}" | jq -r '.[] | .configuration.bucket' | grep "${bucket}")"
|
||||
|
||||
if [[ -z ${preexisting} ]]; then
|
||||
docker exec -u www-data -i "${container}" php --define apc.enable_cli=1 /var/www/html/occ files_external:create "${user_bucket_name}" \
|
||||
|
|
Loading…
Add table
Reference in a new issue