Browse Source

fix: [rsync-backup-target] force restart when config changed

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/1/head
Valentin Lab 4 years ago
parent
commit
908011fc1d
  1. 10
      rsync-backup-target/hooks/init

10
rsync-backup-target/hooks/init

@ -47,9 +47,19 @@ while read-0 ident key; do
keys["$key"]="$ident" keys["$key"]="$ident"
done < <(echo "$keys" | shyaml key-values-0) done < <(echo "$keys" | shyaml key-values-0)
debug "Adding config hash to enable recreating upon config change."
config_hash=$({
## XXXvlab: ``env -i`` sole purpose is to protect find
## against big shell environments, and prevent it to fail.
env -i find "${host_path_key}" \
-name \*.pub -exec md5sum {} \;
} | md5_compat) || exit 1
init-config-add "\ init-config-add "\
$SERVICE_NAME: $SERVICE_NAME:
volumes: volumes:
- $host_path_key:$local_path_key:ro - $host_path_key:$local_path_key:ro
labels:
- compose.config_hash=$config_hash
" "
Loading…
Cancel
Save