#!/bin/sh set -e EVENT_NAME="$1" [ "$EVENT_NAME" = "live-updated" ] || exit 42 MAIN_HOSTNAME="{{ coturn_hostnames[0] }}" SSL_D="{{ coturn_base_path }}/{{ coturn_realm }}/config/ssl" USER="coturn" GROUP="coturn" while read name; do certdir="$ACME_STATE_DIR/live/$name" if [ -z "$name" -o ! -e "$certdir" ]; then continue fi if [ "$name" != "$MAIN_HOSTNAME" ]; then continue fi cp "$certdir/fullchain" "$SSL_D/cert.pem" cp "$certdir/privkey" "$SSL_D/privkey.pem" chown "$USER:$GROUP" "$SSL_D/cert.pem" "$SSL_D/privkey.pem" break ## TODO: trigger restart of coturn!!! done