Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / IkiWiki / Plugin / pingee.pm
blobf5386d0cae4ccb638913c9d6a7ac9a8e2a3d94af
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::pingee;
4 use warnings;
5 use strict;
6 use IkiWiki 3.00;
8 sub import {
9 hook(type => "getsetup", id => "pingee", call => \&getsetup);
10 hook(type => "cgi", id => "pingee", call => \&cgi);
13 sub getsetup () {
14 return
15 plugin => {
16 safe => 1,
17 rebuild => undef,
21 sub cgi ($) {
22 my $cgi=shift;
24 if (defined $cgi->param('do') && $cgi->param("do") eq "ping") {
25 $|=1;
26 print "Content-Type: text/plain\n\n";
27 $config{cgi}=0;
28 $config{verbose}=1;
29 $config{syslog}=0;
30 print gettext("Ping received.")."\n\n";
32 IkiWiki::lockwiki();
33 IkiWiki::loadindex();
34 require IkiWiki::Render;
35 IkiWiki::rcs_update();
36 IkiWiki::refresh();
37 IkiWiki::saveindex();
38 exit 0;