summaryrefslogtreecommitdiff
path: root/nocompile/bin/mime-type
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-05-28 07:16:46 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-05-28 07:16:46 -0500
commit05f18ac5c65755e1dde4d4bd44575011310bc648 (patch)
treefc8120feb1a68a205127ea3219ae0e9b32e5e629 /nocompile/bin/mime-type
parentbab39151c44f47c296a53f32f378b948d6d11cef (diff)
downloadmisc-05f18ac5c65755e1dde4d4bd44575011310bc648.tar.gz
misc-05f18ac5c65755e1dde4d4bd44575011310bc648.zip
added quot to the html entities programs
cat fontfile.808 | fontdump > editme.font ; cat editme.font | fontbuild.sh > filefile2.808 the fontstuff is for text-mode fonts for NetBSD. at least. can probably be used for any binary files if you want. only support for 8x8 fonts in build atm. mime-type got a fix for css
Diffstat (limited to 'nocompile/bin/mime-type')
-rwxr-xr-xnocompile/bin/mime-type12
1 files changed, 7 insertions, 5 deletions
diff --git a/nocompile/bin/mime-type b/nocompile/bin/mime-type
index 2b1bad0..83dc116 100755
--- a/nocompile/bin/mime-type
+++ b/nocompile/bin/mime-type
@@ -1,13 +1,15 @@
#!/bin/sh
-TYPE="$(file -b --mime-type $1)"
-MAIN="$(echo "${TYPE}" | cut -d/ -f1)"
-SUB="$(echo "${TYPE}" | cut -d/ -f2)"
+EXT="$(printf "%s" "$1" | rev | cut -d. -f1 | rev)"
+TYPE="$(file -b --mime-type "$1")"
+MAIN="$(printf "%s" "${TYPE}" | cut -d/ -f1)"
+SUB="$(printf "%s" "${TYPE}" | cut -d/ -f2)"
if [ "_${MAIN}" = "_inode" ];then
- printf "text/plain\r\n"
-# printf "this is a directory or symlink! wtf?!?" #ssssshhhhh
TYPE="text/plain"
fi
if [ "_${MAIN}" = "_text" -a "_${SUB}" != "_html" ];then
TYPE="text/plain"
fi
+if [ "_${EXT}" = "_css" ];then
+ TYPE="text/css"
+fi
printf "%s\r\n" "$TYPE"