1
0
Fork 0
mirror of https://gitlab.com/niansa/simpsh-httpd.git synced 2025-03-06 20:53:36 +01:00
simpsh-httpd/sendfile.sh
2018-07-03 16:27:02 +00:00

16 lines
358 B
Bash

#! /bin/bash
# Check: Is it a Directory, a PHP script or something else?
if [[ "$FILE" == *.php ]]; then
CONTENTTYPE="text/html"
. ./httpheaders.sh
php "$FILE" >> $OUTFILE
elif [ -f "${FILE}" ]; then
CONTENTTYPE="$DEFAULTCONTENTTYPE"
. ./httpheaders.sh
cat "${FILE}" >> ${OUTFILE}
else
CONTENTTYPE="text/html"
. ./httpheaders.sh
. ./filelist.sh
fi