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