#!/bin/bash
if [ $# -ne 1 ]
then
  echo "Usage: `basename $0` user@<hostname>"
  echo "Example: `basename $0` root@devel.foo.com"
  echo "If this is the first time, Do not forget to copy your odbc14.jar under eng/java/lib  to /usr/share/tomcat5/shared/lib on the remote machine"
  exit 65
fi

warfile="$(dirname $(dirname ${0}))/build/**/*.war"
scp $warfile $1:/usr/share/tomcat5/webapps/rhn.war
ssh $1 -t "/etc/init.d/tomcat5 restart"
