#!/bin/sh
# dos (dos shell command)
#
# dos shell command 

###############################################################################################
# CHANGELOG
#===========
# 2010/06/22    CRMS00169018    Jason Zhang
#               add dos protection threshold
#
# 2010/12/09    crms00279336    Jason Zhang     [VHE] "dos summary" don't return right value as cfp rule show
#
###############################################################################################
#crms00279336 jasonaz+
DOS_FUNCTIONS=/etc/dos.functions
if [ -f ${DOS_FUNCTIONS} ]; then
   . ${DOS_FUNCTIONS} 
fi
#crms00279336 jasonaz-

Usage()
{
    echo "dos [summary]"
}
#crms00279336 jasonaz+
#move the functions of dos_info() and dos_summary() to a common file
#crms00279336 jasonaz-

exit_ko()                   
{                           
        echo "KO"           
        exit 1              
}                           
                            
exit_ok()                   
{                           
        echo "OK"           
        exit 0              
}                           

#crms00279336 jasonaz+
#DOS_THRESHOLD_CONF=/etc/dos_threshold.conf
#if [ -f ${DOS_THRESHOLD_CONF} ];then
#   . ${DOS_THRESHOLD_CONF}
#fi
#crms00279336 jasonaz-
[ $# -ne 0 ] || {  dos_info ; exit_ok;}

if [ $1 == "summary" ]; then
   dos_summary
   exit_ok
else
   echo "Unknown command"
   Usage
   exit_ko
fi


