From 5e6cbe34594884c65483235a5d782fe5717cdce6 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Mon, 20 Jun 2016 03:37:22 +0200 Subject: [PATCH] Avoid empty metada files --- example/diameter/pcapDecoder/tsharkDecoder.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example/diameter/pcapDecoder/tsharkDecoder.sh b/example/diameter/pcapDecoder/tsharkDecoder.sh index b713b49..3628318 100755 --- a/example/diameter/pcapDecoder/tsharkDecoder.sh +++ b/example/diameter/pcapDecoder/tsharkDecoder.sh @@ -354,5 +354,13 @@ then rm $RESULTS_DIR/.wanted $RESULTS_DIR/.all fi +# Purge frames with invalid metadata: +invalid=( $(grep -lw "^code=$" $RESULTS_DIR/*metadata) ) +for file in ${invalid[@]} +do + frm=$(basename $file | cut -d\. -f1) + rm $RESULTS_DIR/${frm}.* +done + _exit "Done!" 0 -- 2.20.1