#!/bin/sh

cd "${INSTALL_PATH}${FILE_SEPARATOR}syracuse"

$SHELL "${INSTALL_PATH}${FILE_SEPARATOR}syracuse${FILE_SEPARATOR}servicestop.sh"
$SHELL "${INSTALL_PATH}${FILE_SEPARATOR}syracuse${FILE_SEPARATOR}servicedelete.sh"

#  SAM 111711 - delete content of streamline cache folder 
# list all cache directory should look like that pattern <cacheDir>/<user> and delete the content of that dir 
for f in "${INSTALL_PATH}${FILE_SEPARATOR}syracuse${FILE_SEPARATOR}cache${FILE_SEPARATOR}*"
do
	# remove all content of all folder under cache/user
	rm -rf $f/*
	rm -rf $f/.* # remove file starts with . except "." and ".."

done


if [ -f "SAGE ERP X3 EULA FR".txt ]; then rm -f "SAGE ERP"*.txt; fi
if [ -f "SAGE ERP X3 EULA FR".htm ]; then rm -f "SAGE ERP"*.htm; fi

mkdir update_backup
CURR_DATE=`date +%m-%d-%Y_%H-%M-%S`
cp -f "${syracuse.dir.binpath}${FILE_SEPARATOR}nodelocal.js" "update_backup${FILE_SEPARATOR}nodelocal.js.$CURR_DATE"
cp -f "${syracuse.dir.binpath}${FILE_SEPARATOR}nodelocal.js" "update_backup${FILE_SEPARATOR}nodelocal.js"

exit 0