fix cert handler deleting nginx conf file
This commit is contained in:
+2
-2
@@ -23,12 +23,12 @@ server {
|
||||
}
|
||||
NGINXCONF
|
||||
|
||||
trap '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"' 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"
|
||||
rm -f "/opt/hantim/docker/nginx/conf.d/$APP.conf"
|
||||
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
|
||||
echo "Certificate issued for $APP"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user