From 99f3a362d50ff686779595553fc2d0e56c7fcd25 Mon Sep 17 00:00:00 2001 From: U-Zyn Chua Date: Thu, 12 May 2016 23:44:20 +0800 Subject: [PATCH] Use a more common command to get mimetype --- swarm/cmd/bzzup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swarm/cmd/bzzup.sh b/swarm/cmd/bzzup.sh index 099a5057af..4a7e5a4c2f 100755 --- a/swarm/cmd/bzzup.sh +++ b/swarm/cmd/bzzup.sh @@ -11,7 +11,7 @@ fi if [ -f "$1" ]; then hash=`wget -q -O- --post-file="$1" $proxy/bzzr:/` -mime=`mimetype -b "$1"` +mime=`file --mime-type -b "$1"` # echo wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" $proxy/bzzr:/ wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" $proxy/bzzr:/ echo @@ -31,7 +31,7 @@ name=`echo "$path" | cut -c3-` [ _`basename "$name"` = "_$INDEX" ] && name=`dirname "$name"` echo -n "$delimiter" hash=`wget -q -O- --post-file="$path" $proxy/bzzr:/` -mime=`mimetype -b "$path"` +mime=`file --mime-type -b "$1"` if [ "$mime" = "text/plain" ]; then echo -n $path|grep -q '.css' && mime="text/css" fi