You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
729 B

  1. #!/bin/bash
  2. ## When writing relation script, remember:
  3. ## - they should be idempotents
  4. ## - they can be launched while the dockers is already up
  5. ## - they are launched from the host
  6. ## - the target of the link is launched first, and get a chance to ``relation-set``
  7. ## - both side of the scripts get to use ``relation-get``.
  8. . lib/common
  9. set -e
  10. ## if I'm not linked to a schedule-command, then complain
  11. if read-0 ts _ _ < <(get_service_relation "$SERVICE_NAME" "schedule-command"); then
  12. debug "schedule-command relation fullfilled"
  13. else
  14. ## XXXvlab: relation dependence as this one could actually be implemented in compose-core
  15. err "backup relation requires schedule-command relation to be set"
  16. exit 1
  17. fi