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;
}
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/;