summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/pingee.pm
blob: ee799a57a119b9e079cfc13f81b92b48317a5dc0 (plain)
  1. #!/usr/bin/perl
  2. package IkiWiki::Plugin::pingee;
  3. use warnings;
  4. use strict;
  5. use IkiWiki 2.00;
  6. sub import { #{{{
  7. hook(type => "cgi", id => "aggregate", call => \&cgi);
  8. } # }}}
  9. sub cgi ($) { #{{{
  10. my $cgi=shift;
  11. if (defined $cgi->param('do') && $cgi->param("do") eq "ping") {
  12. $|=1;
  13. print "Content-Type: text/plain\n\n";
  14. $config{cgi}=0;
  15. $config{verbose}=1;
  16. $config{syslog}=0;
  17. print gettext("Ping received.")."\n\n";
  18. IkiWiki::lockwiki();
  19. IkiWiki::loadindex();
  20. require IkiWiki::Render;
  21. IkiWiki::rcs_update();
  22. IkiWiki::refresh();
  23. IkiWiki::saveindex();
  24. exit 0;
  25. }
  26. } #}}}
  27. 1