#!@SHELL@
#######################################################################
#
# Example LCFG Component
#
# @AUTHOR@
# Version @VERSION@ : @DATE@
#
# @MSG@
#
#######################################################################
 
@TESTSHELLV@ . @LCFGCOMP@/ngeneric

##########################################################################
Configure() {
##########################################################################

  # Use sxprof to substitute the configuration parameters from the
  # environment into the template.
  GetSysPath "LCFGBIN"

  $LCFGBIN/sxprof -i $_COMP $LCFG_example_template \
                             $LCFG_example_configfile

  # Was anything changed? Or did the substitution fail?
  status=$?;
  if [ "$status" -eq 2 ] ; then
      LogMessage "configuration changed"
  elif [ "$status" -ne 0 ] ; then
      Fail "failed to create config file (see logfile)"
  fi

  # At this point, we should check if the daemon is running, and
  # if so notify it of any changes (if necessary)
}

##########################################################################
Start() {
##########################################################################

  # Start daemon here
  # Daemon "SOME COMMAND TO RUN MY DAEMON"
  return;
}

##########################################################################
Stop() {
##########################################################################

  # Stop daemon here
  return;
}

##########################################################################
# Dispatch methods
##########################################################################

Dispatch "$@"
