aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/do-build-index
blob: 3855b335e810d41630cf8472dea81ea534763d6a (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
#!/bin/sh

POOLPAGE=/usr/local/www/data/status
TEMPLATESDIR=/usr/local/www/data/scripts/templates

cd $POOLPAGE
cat /dev/null > out.template

echo "<h2>NTP Hosts</h2>
<ul>" >> out.template
for X in `cat /usr/local/www/data/rrd/list-of-systems`
do
	echo "<li><a href=$X>$X</a>" >> out.template
done
echo "</ul>" >> out.template

for X in `cat /usr/local/www/data/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 > index.html

# Build the indexs for the hosts.
for X in `cat /usr/local/www/data/rrd/list-of-systems`
do
	cat /dev/null > out.template
        sed -e s/POOL/$X/g $TEMPLATESDIR/template3 >> out.template
	sync
	cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > $X.html
	rm -f out.template
done