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