replicant-vendor_replicant/get-rommanager
Ladios Jonquil 8c5b23d57e get-rommanager: Prevent saving a broken download
Change-Id: I6a5553f64407b05c20febc1ae44abca52cd2fdea
2011-05-29 16:25:06 -04:00

17 lines
432 B
Plaintext
Executable File

url=http://mirrorbrain.cyanogenmod.com/cm/recoveries/RomManager.apk
apk=RomManager.apk
dir=`dirname $0`/proprietary
mkdir -p $dir
curl -Lo $dir/$apk.new $url || exit $?
mime=`file -b --mime-type $dir/$apk.new`
if [ "$mime" = "application/zip" ]
then
mv $dir/$apk.new $dir/$apk
file --mime-type $dir/$apk
else
echo -n "$dir/$apk.new: "
echo "$mime" | grep text && cat $dir/$apk.new
rm $dir/$apk.new
exit 1
fi