summaryrefslogtreecommitdiffstats
path: root/tools/sfwebcron
blob: c270cef243a5859f18d32bb5b6b2e03d316f48d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
# sfwebcron

# To update the developers-guidelines.html and put in html area
#
# Install in cron with something like:
#  47 7 * * * $HOME/bin/sfwebcron >/tmp/sfwebcron.log 2>&1 || cat /tmp/sfwebcron.log

set -eu
trap 'echo "Command failed at line $LINENO"' ERR

# Set working variables
PROJECT=nagiosplug
IN=${HOME}/sfwebcron
OUT_SERVER="tonvoon@frs.sourceforge.net"
OUT_PATH="/home/groups/n/na/nagiosplug/htdocs"

if [[ ! -e developer-guidelines.html.last ]] ; then
	touch developer-guidelines.html.last
fi

# Get latest dev guildelines
[[ ! -d $IN ]] && mkdir $IN
cd $IN
if [[ ! -d nagios-plugins ]] ; then
	git clone https://github.com/nagios-plugins/nagios-plugins.git nagios-plugins
fi
cd nagios-plugins/doc
git pull

make
if [[ developer-guidelines.html -nt developer-guidelines.html.last ]] ; then
	rsync -av developer-guidelines.{html,sgml} $OUT_SERVER:$OUT_PATH/
	touch developer-guidelines.html.last
fi