From 6d1cec2e2e8271a2022ddb369dd1aca336640f28 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 19 Jul 2011 17:46:14 +0000 Subject: [PATCH] added addtional log output restarting mifare-read on invalid output --- checkcard.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/checkcard.pl b/checkcard.pl index 082b638..ff52a88 100755 --- a/checkcard.pl +++ b/checkcard.pl @@ -41,18 +41,21 @@ sub send_to_fifo read_keys(); -while (sleep 1) +while (sleep 2) { + send_to_fifo("log starting mifare-read"); open $fh,'/flash/tuer/mifare-read 0 2>&1 |'; read_keys() unless ($keys_last_read == -M ($keysfile)); READLOOP: while (<$fh>) - { + while (<$fh>) + { unless (/UID/) { close($fh); - system("/flash/tuer/reset_openpcd.sh"); + system("/usr/bin/killall -9 mifare-read"); + send_to_fifo("log restarting mifare-read after invalid output"); last READLOOP; } my ($id) = /UID=(\S+)\s+/; -- 1.7.10.4