#!/bin/bash
#cd src : there is no source folder in release package

LOG_FILE="/tmp/Loader.log"

if [[ $# -ne 2 ]]; then
	#statements
	echo "invalid parameters number = " $#
fi
if [[ "$1" != "--socket-path" ]]; then
	#statements
	echo "invalid parameter option:" $1
fi

echo $0
cd `dirname $0`

echo "loader is found successfully, execution is starting" >> $LOG_FILE

python ./bin/loader.py $1 $2 >> $LOG_FILE 2>&1

RESULT=$?
if [ $RESULT -ne 0 ]; then
  echo "Loader execution failed with error code $RESULT" >> $LOG_FILE
else
  echo "Loader execution finished successfully" >> $LOG_FILE
fi

