1
0
Fork 0
mirror of https://gitlab.com/niansa/simpsh-httpd.git synced 2025-03-06 20:53:36 +01:00
simpsh-httpd/writehtml.sh
2017-05-27 11:33:49 +02:00

20 lines
443 B
Bash

#! /bin/bash
# Überprüfe: Ist $FILE ein Verzeichniss und enthält es eine index.* ?
# TODO
# Überprüfe: Datei oder Verzeichniss?
if [[ "$FILE" == *.php ]]; then
export CONTENTTYPE="text/html"
. ./httpheaders.sh
php "$FILE" >> $HTMLFILE
elif [ -f "${FILE}" ]; then
export CONTENTTYPE="$DEFAULTCONTENT"
. ./httpheaders.sh
cat "${FILE}" >> ${HTMLFILE}
else
export CONTENTTYPE="text/html"
. ./httpheaders.sh
. ./htmlfilelist.sh
fi