1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_role_nginx.git synced 2024-08-16 16:19:48 +02:00
ansible_role_nginx/files/acmetool/enable_tls.sh
2020-11-02 04:52:31 +01:00

16 lines
356 B
Bash

#!/bin/bash
set -euf -o pipefail
IFS=$'\n'
EVENT_NAME="$1"
[ "$EVENT_NAME" = "live-updated" ] || exit 42
while read -r host; do
if [[ -e "/etc/nginx/sites-available/${host}_tls" ]]; then
echo "Enabling tls site for ${host}"
ln -s -f "/etc/nginx/sites-available/${host}_tls" "/etc/nginx/sites-enabled/${host}_tls"
fi
done
exit 0