#!/bin/sh
fonts=$1
proctype=`uname -m`
if [ ${proctype} = "IP17" -o ${proctype} = "IP20" -o ${proctype} = "IP22" ]
then
  need=4000
  noneed=3000
else
  need=3000
  noneed=4000
fi
echo 'newname=`echo $1 | cut -d. -f1,2`' > /tmp/dum
echo 'mv $1 $newname' >> /tmp/dum
chmod 777 /tmp/dum
find ./*/bin -type f -name "*.${need}" -exec /tmp/dum  {} \;
find ./*/bin -type f -name "*.${noneed}" -exec /bin/rm {} \;
if [ -f ./fonts/${fonts}/fonts.dat ]
then
echo "Choosing fonts"
cd ./fonts
/bin/rm * 2> /dev/null
cd ./${fonts}
find . -type f -name "*" -exec /bin/mv {} .. \;
cd ..
find . -type d -name "BAS*" -prune -exec rm -rf {} \;
cd ..
fi
