<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
package IkiWiki::Plugin::pingee;

use warnings;
use strict;
use IkiWiki 2.00;

sub import {
	hook(type =&gt; "getsetup", id =&gt; "pingee", call =&gt; \&amp;getsetup);
	hook(type =&gt; "cgi", id =&gt; "pingee", call =&gt; \&amp;cgi);
}

sub getsetup () {
	return 
		plugin =&gt; {
			safe =&gt; 1,
			rebuild =&gt; undef,
		},
}

sub cgi ($) {
	my $cgi=shift;

	if (defined $cgi-&gt;param('do') &amp;&amp; $cgi-&gt;param("do") eq "ping") {
		$|=1;
		print "Content-Type: text/plain\n\n";
		$config{cgi}=0;
		$config{verbose}=1;
		$config{syslog}=0;
		print gettext("Ping received.")."\n\n";

		IkiWiki::lockwiki();
		IkiWiki::loadindex();
		require IkiWiki::Render;
		IkiWiki::rcs_update();
		IkiWiki::refresh();
		IkiWiki::saveindex();
		exit 0;
	}
}

1
</pre></body></html>