#!/bin/sh

curl=`which curl`
url='http://streampulse:5052/check?url='

response=`$curl --max-time 30 --silent "$url"`

if echo $response | grep -q "^\[500"; then
	echo "OK: Stream Pulse application UP; response $response"
	exit 0
else
	echo "FAILED: Stream Pulse application might be DOWN; response $response"
	exit 2
fi
