projects
/
svn42.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
initial version of powersensordaemon
[svn42.git]
/
checkcard.pl
diff --git
a/checkcard.pl
b/checkcard.pl
index
ade7c61
..
cc1d1b7
100755
(executable)
--- a/
checkcard.pl
+++ b/
checkcard.pl
@@
-3,19
+3,19
@@
use Socket;
use strict;
my $fh;
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;
my $socketaddr = sockaddr_un($socketfile);
my $keys;
my %good;
-open $keys,'/flash/realraum/keys';
+open $keys,'/flash/keys';
while (<$keys>)
{
while (<$keys>)
{
- if ($_ =~ /([0-9A-Fa-f]{8})\s(\S+)/)
+ chomp;
+ if ($_ =~ /^([0-9A-Fa-f]{8})\s+(.+)$/)
{
$good{$1}=$2;
}
{
$good{$1}=$2;
}
@@
-31,7
+31,7
@@
sub send_to_fifo
while (sleep 1)
{
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/;
while (<$fh>)
{
next unless /UID/;