#!/bin/bash

if [ -n "$1" ]; then
	echo "Backingup /usr/java/default/jre/lib/security/cacerts file to /usr/java/default/jre/lib/security/cacert.bak"
	cp /usr/java/default/jre/lib/security/cacerts /usr/java/default/jre/lib/security/cacerts.bak
	echo "Adding Verimatrix certificate"
	java -classpath /opt/tandbergtv/cms/workflow/plugins/subsystems/Verimatrix/bin com.ericsson.workflow.device.verimatrix.util.InstallCert $1 /usr/java/default/jre changeit /usr/java/default/jre/lib/security/cacerts
else
	echo "Empty Verimatrix IP address & port"
	echo "Usage: ./installCert.sh <Verimatrix IP address>:<port [8090]>"
fi

