Browse Source

fix: [rsync-backup-target] service would not be restarted upon admin key change

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

10
rsync-backup-target/hooks/init

@ -57,6 +57,11 @@ rebuild-config() {
local_path_key=/etc/rsync/keys/admin local_path_key=/etc/rsync/keys/admin
host_path_key="$SERVICE_CONFIGSTORE${local_path_key}" host_path_key="$SERVICE_CONFIGSTORE${local_path_key}"
CONTROL_USERS_FILE="$SERVICE_DATASTORE/.control-pass"
## Was it already properly propagated to database ?
control_users=$(H "${admin_keys}" "$(declare -f "rebuild-config")")
init-config-add "\ init-config-add "\
$SERVICE_NAME: $SERVICE_NAME:
volumes: volumes:
@ -65,11 +70,6 @@ $SERVICE_NAME:
- compose.config_hash=$control_users - compose.config_hash=$control_users
" "
CONTROL_USERS_FILE="$SERVICE_DATASTORE/.control-pass"
## Was it already properly propagated to database ?
control_users=$(H "${admin_keys}" "$(declare -f "rebuild-config")")
if [ -e "$CONTROL_USERS_FILE" ] && [ "$control_users" == "$(cat "$CONTROL_USERS_FILE")" ]; then if [ -e "$CONTROL_USERS_FILE" ] && [ "$control_users" == "$(cat "$CONTROL_USERS_FILE")" ]; then
exit 0 exit 0
fi fi

Loading…
Cancel
Save