chore(scripts): add nginx cleanup for local.4nkweb.com vhost and .bak
All checks were successful
Build and Push to Registry / build-and-push (push) Successful in 51s

This commit is contained in:
NicolasCantu 2025-09-24 18:48:15 +02:00
parent f084e8a6fc
commit 235be939af

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
echo "[nginx-cleanup] Disabling local.4nkweb.com vhost and cleaning old files"
TARGET_ENABLED="/etc/nginx/sites-enabled/local.4nkweb.com-3001"
TARGET_AVAILABLE_PREFIX="/etc/nginx/sites-available/local.4nkweb.com-3000"
if [ -L "$TARGET_ENABLED" ] || [ -e "$TARGET_ENABLED" ]; then
echo "- Removing enabled vhost: $TARGET_ENABLED"
sudo rm -f "$TARGET_ENABLED"
else
echo "- Enabled vhost not present: $TARGET_ENABLED"
fi
echo "- Removing available files: ${TARGET_AVAILABLE_PREFIX}*"
sudo rm -f ${TARGET_AVAILABLE_PREFIX}* || true
echo "- Testing nginx configuration"
sudo nginx -t
echo "[nginx-cleanup] Done. You can now reload: sudo systemctl reload nginx"