projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
03f1140
)
checkphone.pl with zmq doordaemon
author
Bernhard Tittelbach
<xro@realraum.at>
Wed, 2 Oct 2013 22:19:26 +0000
(22:19 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Wed, 2 Oct 2013 22:19:26 +0000
(22:19 +0000)
checkphone.pl
patch
|
blob
|
history
diff --git
a/checkphone.pl
b/checkphone.pl
index
41f9514
..
979c838
100755
(executable)
--- a/
checkphone.pl
+++ b/
checkphone.pl
@@
-4,9
+4,7
@@
use Socket;
use strict;
my $fh;
use strict;
my $fh;
-my $socketfile = $ARGV[0] || "/var/run/tuer/door_cmd.socket";
-sleep(1) while (! -S $socketfile);
-my $socketaddr = sockaddr_un($socketfile);
+my $zmqclient = "/flash/tuer/door_client_zmq";
my $keys;
my %good;
my $keys;
my %good;
@@
-20,8
+18,9
@@
while (<$keys>)
$good{$1}=$2;
}
}
$good{$1}=$2;
}
}
-my $id = $ARGV[2];
-my $action = $ARGV[1];
+my $id = $ARGV[1];
+$id =~ s/^0/+43/;
+my $action = $ARGV[0];
if ($good{$id})
{
if ($action == 1591)
if ($good{$id})
{
if ($action == 1591)
@@
-41,8
+40,9
@@
exit 0;
sub send_to_fifo
{
sub send_to_fifo
{
- socket(my $conn, PF_UNIX, SOCK_STREAM,0) || die "socket: $!";
- connect($conn, $socketaddr) || die "socket connect: $!";
+ open(my $conn, "| ".$zmqclient);
+ #socket(my $conn, PF_UNIX, SOCK_STREAM,0) || die "socket: $!";
+ #connect($conn, $socketaddr) || die "socket connect: $!";
print $conn shift(@_)."\n";
close($conn);
}
print $conn shift(@_)."\n";
close($conn);
}