#!/bin/bash

if which java >/dev/null; then
    cd /opt/zrt && java -Dhttps.protocols=TLSv1.2 -jar /opt/zrt/ZimbraCMSClient.jar -p /opt/zrt/zimbracmsclient.properties
else
    if [ -z ${JAVA_HOME} ]
	    then
	        echo There was not a JAVA_HOME set.  Please set a JAVA_HOME system variable.
          exit 

	    else 
	        cd /opt/zrt && ${JAVA_HOME}/bin/java -Dhttps.protocols=TLSv1.2  -jar /opt/zrt/ZimbraCMSClient.jar -p /opt/zrt/zimbracmsclient.properties
	fi
fi
