summaryrefslogtreecommitdiffstats
path: root/tools/sync_website
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-27 23:10:53 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-27 23:10:53 +0200
commit9ae1cd8f91aa6b53404e66588679d852d3972bcd (patch)
tree1edc8a9ac8e36bf8fabeed7b7b3ad933d691438c /tools/sync_website
parent983d10e0609175a26675a97129b9e7def18d5f35 (diff)
downloadmonitoring-plugins-9ae1cd8f91aa6b53404e66588679d852d3972bcd.tar.gz
tools: Remove Drupal/SourceForge scripts
We moved our web site away from Drupal and the snapshots/guidelines away from SourceForge. The new infrastructure scripts will be maintained in a separate repository together with the Markdown source of the new web site.
Diffstat (limited to 'tools/sync_website')
-rwxr-xr-xtools/sync_website44
1 files changed, 0 insertions, 44 deletions
diff --git a/tools/sync_website b/tools/sync_website
deleted file mode 100755
index 8489bc54..00000000
--- a/tools/sync_website
+++ /dev/null
@@ -1,44 +0,0 @@
1#!/usr/bin/perl
2use strict;
3use DBI;
4#$ENV{PERL5LIB}="plugins-scripts"; # Needed for utils.pm
5
6unless ($ENV{DRUPAL_PASSWORD}) {
7 die "Must set envvar for DRUPAL_PASSWORD";
8}
9
10my $pid = open(F, "-|", qw(ssh -n -N -L 25555:127.0.0.1:3306 nagiosplugins.org));
11
12# Allow time for ssh tunnel to be created
13sleep 2;
14
15# To stop the death of ssh tunnel being defunct
16$SIG{CHLD} = 'IGNORE';
17
18END { kill 'INT', $pid if $pid };
19
20my $dbh = DBI->connect("DBI:mysql:database=drupal;host=127.0.0.1;port=25555", "drupal", $ENV{DRUPAL_PASSWORD});
21
22my @plugin_paths;
23push @plugin_paths, (grep { -x $_ && -f $_ } (<plugins-root/*>, <plugins/*>) );
24
25foreach my $plugin_path (@plugin_paths) {
26 my $plugin = $plugin_path;
27 $plugin =~ s%.*/%%;
28 my $help_option = "--help";
29 $help_option = "-h" if ($plugin eq "check_icmp");
30 my $help = `$plugin_path $help_option` || die "Cannot run $plugin -h";
31 $help =~ s/</&lt;/g;
32 $help =~ s/>/&gt;/g;
33
34 my $rows = $dbh->do("UPDATE node SET created=UNIX_TIMESTAMP(NOW()) WHERE title='$plugin'");
35 unless ($rows == 1) {
36 die "Cannot find $plugin in drupal to update - create book page first";
37 }
38
39 $dbh->do("UPDATE node_revisions SET timestamp=UNIX_TIMESTAMP(NOW()), log='Updated by update_online_manpage', teaser='$plugin --help', body=? WHERE title='$plugin'",
40 {},
41 "<pre>".$help."</pre>");
42}
43
44print "Finished\n";