#!/bin/bash
PARABLU_COMPONENT_SCRIPT_PATH=../config/parablu_component_config.sh
PARABLU_CONFIG_SCRIPT_PATH=../config/parablu_config.sh
source $PARABLU_COMPONENT_SCRIPT_PATH
source $PARABLU_CONFIG_SCRIPT_PATH

export PATH=$PATH:/sbin

rm -rf executiveSummery.txt
nohup java -jar executivesummary-0.0.1-SNAPSHOT.jar &
sleep 30s
curl -sb -H "Accept: application/json" localhost:8112/overallstatistics >> executiveSummery.txt
pkill -f executivesummary-0.0.1-SNAPSHOT.jar
cat executiveSummery.txt | mail -s "Executive report of [$CUSTOMER_NAME]" $WATCHDOG_MAIL_ADDRESS -aFrom:$WATCHDOG_FROM_MAIL_ADDRESS
