#!/bin/sh
#$Id: set_sys_dir,v 1.3 2014/05/20 16:37:42 marcum Exp $
#FUNCTION

#*******************************************************************************
# Function to set the SimSys system directory sys_dir. This is the directory
# that contains sbin and other system directories. Also set the script_dir to
# the location of the sbin directory.
#
# Only for use by scripts in the sbin/ directory.
#*******************************************************************************

set_sys_dir ()
{

	script_path="`readlink $0`"

	if [ "${script_path}" = "" ]; then

		script_path="$0"
	fi

	working_dir="`pwd`"

	script_dir="`dirname ${script_path}`"

	cd ${script_dir}

	script_dir="`pwd`"

	if [ -d "${script_dir}/.." ]; then

		cd ${script_dir}/..

		sys_dir="`pwd`"
	else

		echo ""
		echo "*** unable to find SimSys system directory ***"
		exit
	fi

	cd ${working_dir}
}
