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

17 lines
356 B
Bash
Raw Normal View History

2020-11-02 04:51:35 +01:00
#!/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