Files
sxchnge/infra/local/scripts/start-service.sh
T

16 lines
531 B
Bash
Executable File

#!/bin/sh
set -eu
umask 077
if [ "$SXCHNGE_SERVICE" = notifications ]; then
exec service -config.file=/etc/sxchnge/notifications.yml
fi
if [ "${SXCHNGE_SENDICO_LOCAL:-}" = 1 ]; then
attempt=0
until [ -s /run/sendico/access-token ] && [ "$(($(date +%s) - $(stat -c %Y /run/sendico/access-token)))" -lt 1500 ]; do
attempt=$((attempt+1))
[ "$attempt" -lt 120 ] || { echo 'Local Sendico session did not become ready' >&2; exit 1; }
sleep 2
done
fi
exec service -config.file=/etc/sxchnge/bff.yml