#! /bin/bash
if [ "$1" = "-h" ] ; then echo "$0 : "; echo "           show trace wiegand RAW data" ; exit ; fi
LINES=`grep wiegandclass  /home/st/stlog.log | sed "s/\[DEBUG\] //" | sed "s/stlog - Sthal_wiegandclass_c /wieganclass/" | grep -e Receiver -e Error -e Parity -e card | grep -v facility | wc -l`
if [ "$LINES" == 0 ]
then
	echo "No wiegand data in log"
else
	grep wiegandclass  /home/st/stlog.log | sed "s/\[DEBUG\] //" | sed "s/stlog - Sthal_wiegandclass_c /wieganclass/" | grep -e Receiver -e Error -e Parity -e card | grep -v facility| tac | more  
fi
