#!/bin/sh set -e TEMPLATE=/usr/share/nginx/html/index.html.template TARGET=/usr/share/nginx/html/index.html # שומרים טמפלייט פעם אחת if [ ! -f "$TEMPLATE" ]; then cp "$TARGET" "$TEMPLATE" fi cp "$TEMPLATE" "$TARGET" # מחליף את placeholder של הלינקים ב-JSON מה-ENV if [ -n "$LAB_LINKS" ]; then # משתמש ב-| כדי לא להסתבך עם / ב-URL sed -i "s|__LAB_LINKS__|$LAB_LINKS|g" "$TARGET" fi nginx -g 'daemon off;'