13 remote_host => $query->remote_host,
16 my $dir = $FindBin::Bin;
17 my $path = "$dir/ip/" . $hash->{remote_host};
19 if ( my $ip = $query->param('local_ip') ) {
21 $hash->{local_ip} = $ip;
22 open(my $fh, '>', $path);
23 print $fh $hash->{local_ip};
25 warn "# $path ", -s $path, "\n";
27 } elsif ( -e $path ) {
28 open(my $fh, '<', $path);
30 $hash->{local_ip} = $ip;
33 warn $hash->{_error} = "ERROR: ", $hash->{remote_host}, " don't have RFID reader assigned";
36 if ( $query->param('intranet-js') ) {
37 print "Content-type: application/javascript\r\n\r\n";
38 open(my $js, '<', 'koha-rfid.js');
40 s/localhost/$hash->{local_ip}/g;
45 print "Content-type: application/json; charset=utf-8\r\n\r\n";
46 print encode_json $hash;