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
2018-07-03 16:33:11 +00:00

17 lines
356 B
Bash

#! /bin/bash
# Check: is it a directory or a file?
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
. ./filelist.sh
fi