########################################################################
#
# filename:	irlp_common.sh
#
# description:	Places the commonly used functions into one place where
#		it is eay to get to. This eliminates having to place the
#		commands in each script where they are used. Just need
#		to source this one file to get all of its functions.
#
# history:
# 20030706	kc6hur	Original release
########################################################################

########################################################################
#
# Convenience functions
#
# Send message to LOGFILE
function log () {
  MESSAGE=$@
  if [ -n "$LOGFILE" ]; then
    echo "`date '+%b %d %Y %T %z'` ${0##*/}: $MESSAGE" >> $LOGFILE
  fi
}

#######################################################################
#
# Standard Script Opening
#
# Make sure we are user repeater!!!
if [ `/usr/bin/whoami` != "repeater" ] ; then
  echo This program must be run as user REPEATER!
  exit 1
fi

# Make sure we have sourced the environment file
if [ "$RUN_ENV" != "TRUE" ] ; then
  . /home/irlp/custom/environment
fi

#
# END Common Functions
########################################################################

