]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/conf/load_ips.pl
more support for introspection paging
[Evergreen.git] / Evergreen / conf / load_ips.pl
1 #!/usr/bin/perl
2 use strict; use warnings;
3
4
5 # This file should be loaded by apache on startup (add to a "startup.pl" file)
6
7 open(F,"lib_ips.txt");
8
9 $OpenILS::WWW::Redirect::lib_ips_hash = {};
10 my $hash = $OpenILS::WWW::Redirect::lib_ips_hash;
11
12
13 while( my $data = <F> ) {
14
15         chomp($data);
16
17         my( $reglib, $ip1, $ip2 ) = split(/\t/, $data);
18         next unless ($reglib and $ip1 and $ip2);
19
20         my( $reg, $lib ) = split(/-/,$reglib);
21         next unless ($reg and $lib);
22
23 #       print "$reg : $lib : $ip1 : $ip2\n";
24         
25         $hash->{$reg} = {} unless exists $hash->{$reg};
26         $hash->{$reg}->{$lib} = [] unless exists $hash->{$reg}->{$lib};
27
28         push( @{$hash->{$reg}->{$lib}}, [ $ip1, $ip2 ] );
29 }
30