#!/bin/bash


CONFIG=/ips/setup/.config
. $CONFIG

if [ "$QOS_LOG" != "1"  ]; then
  exit
fi

. /ips/ip2/.functions

X=$1
MA=$2
F=-d

if [ "$X" != "-I" -a "$X" != "-D" -o "$MA" = "" ]; then
  echo "usage : $0 -I|-D ma" 
  exit
fi


    LOG=`cat $IPS/ips/$MA-l 2> /dev/null`

    if [  "$LOG" = ""  ]; then
       exit 0
    fi

    if [  "$X" = "-I"  ]; then
           /ips/ip2/.log $F --off $MA 2> /dev/null 
           /ips/ip2/.log $F --on $MA
            res=$?
    fi

    if [  "$X" = "-D"  ]; then
           /ips/ip2/.log $F --off $MA
	   # 2> /dev/null 
           /ips/ip2/.log $F --off $MA 2> /dev/null 
            res=0
    fi
    
 
if [  $res = 0 ]; then
  echo ok
else
  echo failed
fi  
  
exit $res
