fix: stop Zoraxy before running tool to free port 80 for ACME

This commit is contained in:
Claus Lohmar 2026-07-07 14:44:13 +01:00
parent 360112c7b7
commit 63099703a1

View file

@ -56,15 +56,18 @@ fi
# --- Greenfield path --- # --- Greenfield path ---
if [ "$GREENFIELD" = true ]; then if [ "$GREENFIELD" = true ]; then
# Step 3: Stop service and wipe # Step 3: Stop all services and free port 80 for ACME challenge
echo "[3/6] Stopping service and cleaning production directory..." echo "[3/6] Stopping all services..."
systemctl stop $SERVICE_NAME 2>/dev/null || true systemctl stop $SERVICE_NAME 2>/dev/null || true
podman rm -f zoraxy 2>/dev/null || true
# Wipe production directory
if [ -d "$TARGET_DIR" ]; then if [ -d "$TARGET_DIR" ]; then
chattr -R -i "$TARGET_DIR" 2>/dev/null || true chattr -R -i "$TARGET_DIR" 2>/dev/null || true
rm -rf "$TARGET_DIR" rm -rf "$TARGET_DIR"
fi fi
# Step 4: Run helper tool — checks /opt/backup/certs/, issues LE if missing # Step 4: Run helper tool — port 80 is free, can obtain LE certs via HTTP-01
echo "[4/6] Checking certificates..." echo "[4/6] Checking certificates..."
mkdir -p "$BACKUP_DIR/certs" mkdir -p "$BACKUP_DIR/certs"
if [ -f "$TOOL_BIN" ]; then if [ -f "$TOOL_BIN" ]; then