#!/bin/bash

##########################################################################################
##
##  script for jaguar server status
##
##  exitcode: 0: still running; 1: stopped
##
##########################################################################################

. `dirname $0`/jaguarenv

hn=`hostname`
myip=`hostname -I|cut -d' ' -f1`

if [[ "x$pid" != "x" ]]; then
  	echo "jaguar server is running on $hn $myip"
	exit 0
else
  	echo "jaguar server is stopped on $hn $myip"
    if [[ -f $JAGUAR_HOME/log/jaguar.log ]]; then
        tail -5 $JAGUAR_HOME/log/jaguar.log
    fi
	exit 1
fi

