fix idempotency in app.sh, service.sh and nginx reload in cert handler
This commit is contained in:
+2
-1
@@ -23,13 +23,14 @@ server {
|
||||
}
|
||||
NGINXCONF
|
||||
|
||||
trap 'git -C /opt/hantim restore "docker/nginx/conf.d/$APP.conf" 2>/dev/null || rm -f "/opt/hantim/docker/nginx/conf.d/$APP.conf"' EXIT
|
||||
trap 'git -C /opt/hantim restore "docker/nginx/conf.d/$APP.conf" 2>/dev/null || rm -f "/opt/hantim/docker/nginx/conf.d/$APP.conf"; docker exec nginx nginx -t && docker exec nginx nginx -s reload' EXIT
|
||||
docker exec nginx nginx -t && docker exec nginx nginx -s reload
|
||||
certbot certonly --webroot -w /opt/hantim/docker/nginx/certbot/www \
|
||||
--non-interactive --agree-tos -m timothykim@fastmail.fm \
|
||||
--cert-name "$APP" -d "$APP" -d "www.$APP"
|
||||
git -C /opt/hantim restore "docker/nginx/conf.d/$APP.conf" 2>/dev/null || rm -f "/opt/hantim/docker/nginx/conf.d/$APP.conf"
|
||||
trap - EXIT
|
||||
docker exec nginx nginx -t && docker exec nginx nginx -s reload
|
||||
echo "Certificate issued for $APP"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user