X-Git-Url: http://git.rot13.org/?p=koha-bibliografija;a=blobdiff_plain;f=html.pl;fp=html.pl;h=968b20fffb65e50fa1e11676d50ff13d5d1c67fe;hp=ad942ffeb8d5a918475e0cc029b3fddf904e8e09;hb=e511191929b98e883fa85fded8947de7d78ef881;hpb=0940e8776aee0223107b22529af6d5ea52703f47 diff --git a/html.pl b/html.pl index ad942ff..968b20f 100755 --- a/html.pl +++ b/html.pl @@ -21,6 +21,20 @@ use C4::Context; use XML::LibXML; use XML::LibXSLT; +my $pid_file = '/dev/shm/bibliografija.pid'; +{ + if ( -e $pid_file ) { + open(my $fh, '<', $pid_file); + my $pid = <$fh>; + no autodie; # it will die on kill + kill 0, $pid || die "$0 allready running as pid $pid"; + } + open(my $fh, '>', $pid_file); + print $fh $$; + close($fh); +} + + my $dbh = C4::Context->dbh; sub debug { @@ -806,3 +820,5 @@ close($fh2); rename 'html/azvo.new', 'html/azvo.html'; rename 'html/azvo2.new', 'html/azvo2.html'; +unlink $pid_file; +