#!/bin/sh

echo "This script removes the unwanted vmnet interfaces from an Athena"
echo "machine which took the 9.4.44 and/or 9.4.45 releases from the dev"
echo "cell."
echo

if ! ifconfig -a | grep -q vmnet; then
  echo "You do not appear to have the unwanted interfaces.  Exiting."
  exit
fi

case `machtype -L` in
9.4.44|9.4.45)
  echo "Please update to version 9.4.46 and re-run this script."
  echo "Exiting."
  ;;
9.4.4[6-9]|9.4.[5-9][0-9]|9.4.???)
  echo "Removing and reinstalling the VMwarePlayer RPM.  It will be"
  echo "configured properly at the next boot."
  echo
  rpm -e VMwarePlayer
  rpmpath=`awk '/VMwarePlayer/ { print $1 }' /var/athena/release-rpms`
  cd /afs/dev.mit.edu/system/rhlinux
  rpm -Uvh $rpmpath
  echo "Done."
  ;;
*)
  echo "This machine is not running a targeted release for this"
  echo "script.  Exiting."
  ;;
esac
