infrastructure/playbooks/roles/lego/files/lego.sh
Tobias Reisinger 4104057771
Fix pre-commit hooks and move directories
roles/ and inventory/ are now in playbooks/
also fixed issues reported by ansible-lint
2024-10-14 18:31:36 +02:00

26 lines
420 B
Bash
Executable file

#!/usr/bin/env sh
set -a
. ./service.env
set +a
domain="$1"
action="run"
exisiting_domains=$(docker compose run --rm app list -n)
if echo "$exisiting_domains" | grep -q "$domain";
then
action="renew"
fi
docker compose run --rm app \
--domains "$domain" \
"$action" \
"--$action-hook" "/config/hook.sh"
if [ "$?" = "33" ] && [ -x "./hooks/$domain" ];
then
echo "Running hook for $domain"
"./hooks/$domain"
fi