#! /bin/sh
#
#	Shell script for the installation X fonts
#	on the local Host.
#
#    @(#)pm_font_upgrade 1.1 11/15/91 Copyright 1991 Livingston Enterprises Inc
#
#
#
PATH=/bin:/usr/bin:/usr/ucb:$PATH
#
#	Set up global variables.
#
UNAME=`whoami`
INSTALL_DIR=/usr/lib/X11/fonts/apps/75dpi
FONTCOMP=/usr/bin/dxfc
FONTMKDIR=/usr/bin/X11/mkfontdir
DIR=`expr \
  ${0-.}'/' : '\(/\)[^/]*/$' \
  \| ${0-.}'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \
  \| .`
#
#	Must be run as root
#
if [ "$UNAME" != "root" ]; then
	echo "Font installation must be run as root."
	echo "Installation Aborted."
	exit 0
fi
#
echo 'Performing Font Installation.'
#
#
cd $DIR/Xfonts/75dpi
echo 'Uncompressing font files.'
uncompress *.Z
echo 'Compiling and installing fonts.'
for i in *.bdf
do
	NEWNAME=`echo $i | awk '-F.' '{printf("%s.pcf", $1)}'`
	if [ ! -f $INSTALL_DIR/$NEWNAME ]
	then
		$FONTCOMP $i > $INSTALL_DIR/$NEWNAME
	fi
done
#
echo 'Creating font listing.'
#
cd $INSTALL_DIR
$FONTMKDIR
#
echo "Font Installation completed."
#
