X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=checkcard.pl;h=cc1d1b715a11cddcf31e92213e0afddd542e0af7;hb=efb533dcb175bf15fd003a635d77b6ff15756b6f;hp=ade7c619452667692d653161508514f650dd3043;hpb=a5e721c8dbf397c6a5aa5131a9b6cf9f15cc6f7b;p=svn42.git diff --git a/checkcard.pl b/checkcard.pl index ade7c61..cc1d1b7 100755 --- a/checkcard.pl +++ b/checkcard.pl @@ -3,19 +3,19 @@ use Socket; use strict; my $fh; -#my $fifofile = "/tmp/door_cmd.fifo"; -my $socketfile = "/tmp/door_cmd.socket"; -exit(1) unless (-S $socketfile); +my $socketfile = $ARGV[0] || "/var/run/tuer/door_cmd.socket"; +sleep(1) while (! -S $socketfile); my $socketaddr = sockaddr_un($socketfile); my $keys; my %good; -open $keys,'/flash/realraum/keys'; +open $keys,'/flash/keys'; while (<$keys>) { - if ($_ =~ /([0-9A-Fa-f]{8})\s(\S+)/) + chomp; + if ($_ =~ /^([0-9A-Fa-f]{8})\s+(.+)$/) { $good{$1}=$2; } @@ -31,7 +31,7 @@ sub send_to_fifo while (sleep 1) { - open $fh,'/flash/realraum/mifare-read 0 2>&1 |'; + open $fh,'/flash/tuer/mifare-read 0 2>&1 |'; while (<$fh>) { next unless /UID/;