#!/bin/bash
sed -i 's/java -jar/java -Dlog4j2.formatMsgNoLookups=true -jar/g' /opt/phoenix/phscripts/bin/run-svnlite.sh
systemctl restart svnlite
sleep 3
ps -ef | grep svn | grep formatMsgNoLookups=true >/dev/null
if (( $? == 0 )); then
  printf "\nFortiSIEM SVNLite log4j2 fix is patched.\n\n"
else
  printf "\nPlease contact FortiSIEM support to solve log4j2 issue for SVNLite.\n\n"
fi
