#!/bin/sh

if [ $# -eq 0  ]; then
/usr/bin/ICTApplication/ICTCliGateLite --call LoggerModule:level



else if [ $# -eq 2  ]; then
/usr/bin/ICTApplication/ICTCliGateLite --call LoggerModule:level --args $1 $2
else if [ $# -eq 1  ]; then
	case $1 in --help) 
	echo "  ________________________________________________________________          "
	echo " |                                                                |         "
	echo " |  OBJECT :                                                      |         "
	echo " |  Used to change the level filtering parameters in the          |         "  
	echo " |  syslog-ng configuration file.                                 |         "
	echo " |                                                                |         "
	echo " |   ====================================                         |         "
	echo " |   |level with no input parameters    |                         |         "
	echo " |   ====================================                         |         "
	echo " |                                                                |         "
	echo " |   COMMAND : level                                              |         "
	echo " |                                                                |         "
	echo " |   Result : a table with all the syslog-ng configurations       |         "
	echo " |   EXAMPLE of level output :                                    |         "
	echo " |                                                                |         "
	echo " |   <Activity>    <Level>        <Destination>         <Support> |         "
	echo " |    ictaudio     warning    /var/log/ictaudio.log       file    |         "
	echo " |    ictsipua     err        IP :00.11.22.33 port (54)   udp     |         "	
	echo " |                                                                |         "
	echo " |  ====================================                          |         "
	echo " |  |    level with one  parameter     |                          |         "
	echo " |  ====================================                          |         "
	echo " |                                                                |         "
	echo " |  COMMAND :level  --help                                        |         "
	echo " |  Print all the level commands, with some examples              |         "
	echo " |       		                                                    |         "
	echo " |  ====================================                          |         "
	echo " |  |    level with two  parameters    |                          |         "
	echo " |  ====================================	                        |         "
	echo " |                                                                |         "
	echo " |  COMMAND :level  <activity> <level>                            |         " 
	echo " |                                                                |         "
	echo " |  activity : the name of a activity                             |         " 
	echo " |  level    : a predefined level in a existing list :            |         " 
	echo " |             debug, info,notice,warning,err, emerg              |         "
 	echo " |                                                                |         "
	echo " |  Example :                                                     |         "
	echo " |  level ictaudio debug    --> set level filering to debug       |         "
	echo " |                              for activity ictaudio             |         "
	echo " |                                                                |         "
	echo " |                                                                |         "
	echo " |  Using particular facility : all                               |         "   
	echo " | =========================                                      |         "
	echo " |                                                                |         "
	echo " |  Set all activities to predefined level filtering : err        |         "   
	echo " |                                                                |         "
	echo " |  Format : level all init                                       |         " 
	echo " |                                                                |         "
	echo " |  Set all activities level filtering to a choosed value :       |         "   
	echo " |                                                                |         "
	echo " |  Format :  level all err  --> all activities set               |         "
	echo " |                               to error level                   |         "
	echo " |                                                                |         "
	echo " |                ------- End of Help -------                     |         "
	echo " |________________________________________________________________|         "
	;;
	esac   

	else echo "invalid parameters"
	fi
  fi
 fi



