aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/do-build-site
blob: 03994673b1110c1c07bb16858af66ede815b8635 (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/sh

POOLPAGE=/var/www/time.mattrude.com/status
TEMPLATESDIR=/var/www/time.mattrude.com/scripts/templates

mkdir -p $POOLPAGE
cd $POOLPAGE
cat /dev/null > out.template

echo "<h2>Time Server Hosts</h2>
<ul>" >> out.template
for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
do
	echo "<li><a href=/status/$X/>$X</a>" >> out.template
done
echo "</ul>" >> out.template

for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
do
	sed -e s/POOL/$X/g $TEMPLATESDIR/template >> out.template
done

sync
cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > $POOLPAGE/index.html

# Build the indexs for the hosts.
for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
do
	mkdir -p $POOLPAGE/$X
	cat /dev/null > out.template
        sed -e s/POOL/$X/g $TEMPLATESDIR/template-host >> out.template
	sync
	cat out.template $TEMPLATESDIR/index-tail > $X/index.html
	rm -f out.template
done
chown -R apache:apache $POOLPAGE