diff --git a/root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/up b/root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/up index 81f6412..b4936e8 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/up +++ b/root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/up @@ -1,2 +1,20 @@ #!/command/with-contenv bash -mkdir -p /config /app/www \ No newline at end of file + +# Standard-Verzeichnisse erstellen +echo "Erstellen der Standard-Verzeichnisse..." +mkdir -p /config /app/www +echo "Ordner wurden angelegt" +# Config kopieren, falls nicht vorhanden +if [ ! -f /config/lighttpd.conf ]; then + echo "Keine Konfiguration gefunden, kopiere Standard..." + cp /defaults/lighttpd.conf /config/lighttpd.conf +fi + +# Dummy Index-Datei erstellen, falls leer +if [ ! -f /app/www/index.html ]; then + echo "

Es funktioniert!

Lighttpd auf Alpine.

" > /app/www/index.html +fi + +# Berechtigungen korrigieren (fuer User abc) +chown -R abc:users /config +chown -R abc:users /app/www \ No newline at end of file