summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/scripts/matcher.sh
blob: 7bdf033df25fa45dae2d8ea5de3fd981d61a29e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
# matcher helper script
#
CMD=$1
cd `dirname $0`/..; prjhome=$PWD/packetmatcher
M2CLASSPATH=$prjhome/.m2classpath 

#
# Usage
#
usage () {
cat <<EOT
#
#  Matcher
#

USAGE: matcher.sh start [OPTIONS] 
       matcher.sh clean  

Use "matcher.sh start -h" for help.

EOT
}
#
# Start Packet Matcher
#
start (){
 if  [ ! -r $M2CLASSPATH ]; then
    echo "=== Extracting classpath (.m2classpath) ===" 
    cd $prjhome
    mvn compile exec:exec -Dmaven.test.skip=true
 fi
 cd $prjhome
# ../scripts/m2run de.fhg.fokus.net.packetmatcher.Matcher
  ../scripts/m2run -Dmainclass=de.fhg.fokus.net.packetmatcher.Matcher org.kohsuke.args4j.Starter $*
}


#
# MAIN
#


case $CMD in
  clean)
  echo "Removing $M2CLASSPATH" 
  rm -f $M2CLASSPATH
  ;;
  start)
    shift
    start $*
  ;;
  *)
    usage
esac