#!/bin/bash

BLUE='\033[0;34m'
NO_COLOR='\033[0m'


application_pid=$(pgrep "application")
if [ -n "$application_pid" ]; then
        echo -e -n "${BLUE}killing old instance... ${NO_COLOR}"
        killall application
        echo "done"
fi
$(sleep 8 && kill -USR1 $(pidof "application")) &
#xdg-open "http://localhost:8065" 2>/dev/null
$1 ./application --docroot . --http-address 0.0.0.0 --http-port 8065

