mirror of
https://gitlab.com/niansa/simpsh-httpd.git
synced 2025-03-06 20:53:36 +01:00
Update mkdeb.sh, config.sh, sendfile.sh files
This commit is contained in:
parent
7117ecacaf
commit
a601aba795
3 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,9 @@ WEBSITE="http://localhost:$PORT"
|
|||
# Should PHP be enabled? You need to install php-cli package to use it. May be false or true
|
||||
ENABLE_PHP="false"
|
||||
|
||||
# Should Markdown be enabled? You need to install markdown package to use it. May be false or true
|
||||
ENABLE_MARKDOWN="false"
|
||||
|
||||
# Error code pages, they need to be HTML documents
|
||||
ERROR404="${FILES}/404.html"
|
||||
ERROR403="${FILES}/403.html"
|
2
mkdeb.sh
2
mkdeb.sh
|
@ -19,7 +19,7 @@ Maintainer: nisa/niansa <nisa@bitcoinshell.mooo.com>
|
|||
Priority: extra
|
||||
Architecture: all
|
||||
Depends: bash, socat
|
||||
Recommends: php7.2-cli
|
||||
Recommends: php7.2-cli, markdown
|
||||
Description: An usable bash-httpserver with easy configuration and very simple PHP' > ~/simpsh-httpd-pkg/DEBIAN/control
|
||||
cd ..
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@ if [[ "$FILE" == *.php ]] && [ "$(which php)" != "" ] && [ "$ENABLE_PHP" = "true
|
|||
CONTENTTYPE="text/html"
|
||||
. ./httpheaders.sh
|
||||
php "$FILE" >> $OUTFILE
|
||||
elif [[ "$FILE" == *.md ]] && [ "$(which markdown)" != "" ] && [ "$ENABLE_MARKDOWN" = "true" ]; then
|
||||
CONTENTTYPE="text/html"
|
||||
. ./httpheaders.sh
|
||||
markdown -b "$FILES" "$FILE" >> $OUTFILE
|
||||
elif [ -f "${FILE}" ]; then
|
||||
CONTENTTYPE=$(file -b -i "$FILE")
|
||||
. ./httpheaders.sh
|
||||
|
|
Loading…
Add table
Reference in a new issue