#!/bin/ksh
current_dir=`pwd`
user=`/usr/bin/whoami`
echo "Filetype rules for IRIX"
echo "fixes for AW .iff files, assigned to fcheck"
echo "assigning .psd files to The GIMP"
echo "assigning .tga files to fcheck"
echo "assigning .zip files to unzip"
echo "by Soren 'kurgan' Jacobsen"
echo "kurgan@ns-media.dk"
echo "use at your own risk"
if [ "$user" = "root" ]; then
  echo "making backup of aw.ftr in aw.ftr.bak"
  mv /usr/lib/filetype/install/aw.ftr /usr/lib/filetype/install/aw.ftr.bak
  echo "installing icons.."
  cp $current_dir/files/*.ftr /usr/lib/filetype/install/
  cp $current_dir/files/iconlib/*.fti /usr/lib/filetype/install/iconlib/
  cd /usr/lib/filetype
  make
  echo "echo installation complete.."
  echo "log out and in, for changes to take effect"
  echo "to restore original setup:"
  echo "run uninstall"
else
  echo "You need to be root to install"
  echo "exiting..."
fi
