Changing access for the scripts.
[pingpong.git] / Code / Projects / PacketLevelSignatureExtractor / execute_vpn_unsw_all_detection.sh
1 #!/bin/bash\r
2 \r
3 # Arg1 should point to the folder with UNSW traces (PCAP files w/o any expected events).\r
4 UNSW_TRACES_DIR=$1\r
5 \r
6 # Arg2 should point to the base directory  for signature files (i.e., /some/local/path/experimental_result/standalone)\r
7 SIGNATURES_BASE_DIR=$2\r
8 readonly SIGNATURES_BASE_DIR\r
9 \r
10 # Arg3 should point to base directory where the detection results for the UNSW trace are to be output.\r
11 # Subfolders will be created for each individual pcap file in UNSW_TRACES_DIR.\r
12 OUTPUT_DIR=$3\r
13 readonly OUTPUT_DIR\r
14 \r
15 #set -x # echo invoked commands to std out\r
16 \r
17 for PCAP_FILE in $UNSW_TRACES_DIR/*.pcap; do\r
18     # skip non pcap files\r
19     [ -e "$PCAP_FILE" ] || continue\r
20     # make an output sub dir in the base output dir that is the filename minus extension\r
21     OUTPUT_SUB_DIR=$(basename "$PCAP_FILE" .pcap)\r
22     ./execute_layer2_unb_all_detection.sh $PCAP_FILE $SIGNATURES_BASE_DIR $OUTPUT_DIR/$OUTPUT_SUB_DIR\r
23 done\r
24 \r
25 \r