#!/bin/sh
# Created: Alexandra Reznik
# Manage traffic (start, status, stop) according to input parameter  #
# Usage: ./proxy <mode>                                              #
######################################################################
mode=$1;
case $mode in
    start|START|Start)    cd $conformance_dir/proxy; nohup java -cp lib/proxy.jar:lib/JainSipApi1.1.jar:lib/nist-sdp-1.0.jar:lib/nist-sip-1.2.jar:lib/tracesviewer.jar gov.nist.sip.proxy.Proxy -cf configuration/gov/nist/sip/proxy/configuration/configuration.xml &;; 
    status|STATUS|Status) ps -ef|grep proxy.jar|grep -v grep|grep -v vi;;
    stop|Stop|STOP)       ps -ef|grep proxy.jar|grep -v grep|awk '{print $2}'|xargs kill;;
esac
exit
