blob: 71982d923e232ae0ea65e8a4234ae3b6611072e6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
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"
|