1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00
nux-env/inc/nux/mime.nuxsh.sh
root a7b55553ad Nuweb drop
Signed-off-by: root <root@tdm-cloud.(none)>
2019-03-09 12:32:11 +01:00

37 lines
696 B
Bash
Executable file

function nux.mime {
nux.mime.naive.suffix "$@"
}
@namespace nux.mime {
function :naive.suffix filename {
local type=binary/octet
local suffix="${filename##*.}"
suffix="${suffix,,}"
if [ -d "$filename" ]; then
type=directory
else
case "${suffix,,}" in
txt) type=text/plain;;
css) type=text/css;;
jpeg) ;&
jpg) type=image/jpeg;;
png) type=image/png;;
zip) type=application/zip;;
cbr) type=application/x-cbz;;
cbz) type=application/x-cbr;;
pdf) type=application/pdf;;
epub) type=application/epub+zip;;
mp4) type=video/mp4;;
esac
fi
echo $type;
}
}