From 8b1c2f7e40f9c7ae77d3afb9f3eec21886c8f060 Mon Sep 17 00:00:00 2001 From: Epoch Qwert Date: Sun, 23 Nov 2014 14:35:17 -0600 Subject: noticed mime-type, which is used by httpd, wasn't included. --- nocompile/bin/mime-type | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 nocompile/bin/mime-type (limited to 'nocompile/bin') diff --git a/nocompile/bin/mime-type b/nocompile/bin/mime-type new file mode 100755 index 0000000..71982d9 --- /dev/null +++ b/nocompile/bin/mime-type @@ -0,0 +1,13 @@ +#!/bin/sh +TYPE="$(file -b --mime-type $1)" +MAIN="$(echo "${TYPE}" | cut -d/ -f1)" +SUB="$(echo "${TYPE}" | cut -d/ -f2)" +if [ "_${MAIN}" = "_inode" ];then + printf "text/plain\r\n" + printf "this is a directory or symlink! wtf?!?" + TYPE="text/plain" +fi +if [ "_${MAIN}" = "_text" -a "_${SUB}" != "_html"];then + TYPE="text/plain" +fi +printf "%s\r\n" "$TYPE" -- cgit v1.2.3