#!/bin/bash

BASE_DIR="$(cd "$(dirname "$0")"; pwd)";

. $BASE_DIR/env.sh

mkdir -p /tmp/wasup-agent
rm -rf /tmp/wasup-agent/*
wget http://$MANAGER_URL/static/repository/agent/wasup-agent.tar.gz -O /tmp/wasup-agent/wasup-agent.tar.gz
cd /tmp/wasup-agent
tar xf wasup-agent.tar.gz
cp -f lib/wasup-agent.jar $BASE_DIR/../lib/

sh $BASE_DIR/kill.sh
sleep 1
sh $BASE_DIR/start.sh