echo "This script uses wget to download a patch for Vagrant 1.8.5 so that it works with RHEL based os.  You need to be root to use this"
id_user=`id -u`
if [ $id_user -ne 0 ] ; then
   echo "Must be root to use this script"
   exit 1
fi
vagrant_dir="/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/linux/cap/"
vagrant_patched_file="public_key.rb"
wget_binary='wget'
if [ -s $vagrant_dir/$vagrant_patched_file ] ; then
   wget_bin=`which $wget_binary`
   if [ -z $wget_bin ] ; then 
         echo "Wget is not installed"
         exit 2
   fi
   cd $vagrant_dir
   mv $vagrant_dir/$vagrant_patched_file $vagrant_dir/${vagrant_patched_file}.orig
   $wget_bin http://sldist.fnal.gov/linux/fermi/contrib/vagrant/fermi-kerberized-ssh/vagrant185patch/public_key.rb
else
   echo "Vagrant not in $vagrant_dir"
fi
