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
All checks were successful
Build and Push to Registry / build-and-push (push) Successful in 51s
This commit is contained in:
parent
f084e8a6fc
commit
235be939af
22
scripts/nginx_cleanup_local4nk.sh
Executable file
22
scripts/nginx_cleanup_local4nk.sh
Executable 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"
|
Loading…
x
Reference in New Issue
Block a user