composition.shouldBeSyncedByThisHost() extended to composition.shouldBeSyncedByGivenHost() to enable check in sync-send.sh

This commit is contained in:
m8in
2026-06-19 23:14:36 +02:00
parent ffebc8c66e
commit 86be20d2bd
3 changed files with 25 additions and 19 deletions
@@ -1,5 +1,6 @@
#!/bin/bash
source /cis/core/base.module.sh
base.loadModule composition
@@ -136,6 +137,10 @@ base.set COMPOSITION "${3}" "${REGEX[COMPOSITION]}"
base.set RECEIVERS_SNAPSHOT "${4}" "${REGEX[SNAPSHOT]}" optional
base.set RESUME_TOKEN "${5}" '^[a-zA-Z0-9][a-zA-Z0-9._:-]*$' optional
! composition.shouldBeSyncedByGivenHost "${COMPOSITION}" "${RECEIVERHOST}" \
&& echo "FAILURE: The host '${RECEIVERHOST}' is no sync-host for composition: '${COMPOSITION}'" >&2 \
&& exit 1
# Resume mode
if [ "${RECEIVERS_SNAPSHOT}" == "@RESUME" ] && [ -n "${RESUME_TOKEN}" ]; then
sendResume "${RESUME_TOKEN}"