#!/bin/sh

type=$1
action=$2
para1=$3
para2=$4

case "$action" in
start)
        case "$type" in
                tcpdump)
                        /bin/rm -f /www/tcpdump.pcap
                        /usr/sbin/tcpdump -w /www/tcpdump.pcap -i eth0 &
                        /etc/scripts/watch_tool.sh &
                        ;;
                ping)
                        /bin/ping "$para1" -c "$para2" 2> /www/ping.log| tee > /www/ping.log &
                        ;;
        esac
        ;;
stop)
        case "$type" in
                tcpdump)
                        killall tcpdump
                        ;;
                ping)
                        killall ping
                        ;;
        esac
        ;;
*)
        echo "$0 mode = *"
        ;;
esac
exit
