aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/do-build-site
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/do-build-site')
-rwxr-xr-xscripts/do-build-site35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/do-build-site b/scripts/do-build-site
new file mode 100755
index 0000000..4343370
--- /dev/null
+++ b/scripts/do-build-site
@@ -0,0 +1,35 @@
+#!/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>NTP Hosts</h2>
+<ul>" >> out.template
+for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
+do
+ echo "<li><a href=$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
+ 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
+chown -R apache:apache $POOLPAGE