A new user interface for you! Read more...

File fetchmsttfonts.sh.in of Package fetchmsttfonts

#!/bin/sh

EULA="http://corefonts.sourceforge.net/eula.htm"

POST_MESSAGE="/var/adm/update-messages/__NAME__-__VERSION__-__RELEASE__-1"

FONTS=" \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/andale32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe  \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/arialb32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/comic32.exe  \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/courie32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/georgi32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/impact32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/times32.exe  \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/trebuc32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/verdan32.exe \
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/webdin32.exe \
"

CURL_OPTIONS="-L -s --speed-limit 3500 --speed-time 15"

echo "EULA:"
echo -n "  Fetching   ... "
curl $CURL_OPTIONS -o /usr/share/doc/corefonts/EULA.html $EULA || \
  rm -f /usr/share/doc/corefonts/EULA.html
echo "done"

tmpname=$(basename "$0")
tmpdir=$(mktemp -d "/tmp/$tmpname.XXXXXX")
trap "rm -rf $tmpdir" EXIT
if [ $? -ne 0 ]; then
  echo "$0: Can't create temp dir, exiting..."
  exit 4
fi

cd "$tmpdir"

for archive in $FONTS; do
    file=$(echo "$archive" | awk -F "/" '{print $NF}')
    echo "$file ($archive):"
    echo -n "  Fetching   ... "

    if ! curl $CURL_OPTIONS -o "$file" "$archive"; then
        rm -f "$file"
        echo "failed ... deleted!"
        continue
    fi

    for algo in md5 sha1 sha512; do
        if ! grep "$file" "__DOCDIR__/__NAME__/corefonts.$algo" | ${algo}sum --check --quiet --status > /dev/null 2>&1; then
            rm -f "$file"
            echo "$algo checksum mismatch for $file ... deleted!"
            continue
        fi
    done

    echo "done"
    echo -n "  Extracting ... "
    if ! cabextract -l "$file" >/dev/null 2>&1; then
        rm -f "$file"
        echo "failed ... deleted!"
    else
        cabextract "$file" >/dev/null 2>&1
        echo "done"
        success=true
    fi

    rm -f "$file"
done

if [ "x$success" != "x" ]; then 
    for i in ./*.[Tt][Tt][CFcf]; do
        lower=$(echo "$i" | tr "[:upper:]" "[:lower:]")
        test "$i" != "$lower" && mv "$i" "$lower"
    done

    chmod 644 ./*.tt[cf]
    mv -f ./*.tt[cf] /usr/share/fonts/truetype
    /usr/sbin/fonts-config
    echo "*** Fonts installed. ***" | tee $POST_MESSAGE
else
    echo "*** No Fonts installed. ***" | tee $POST_MESSAGE
fi

test -f /usr/share/doc/corefonts/EULA.html && w3m -dump /usr/share/doc/corefonts/EULA.html | tee $POST_MESSAGE