aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-site.sh
diff options
context:
space:
mode:
authorMatt Rude <[email protected]>2011-06-26 00:19:06 -0500
committerMatt Rude <[email protected]>2011-06-26 00:19:06 -0500
commit611bee7dfb28ce68044ba062fa3e012ba1b19829 (patch)
treec5b93a6905a39705f03e00410a43b7edebd8ce4e /scripts/build-site.sh
parent9b389a1bafb007338b4b59559741e461f3e880b2 (diff)
downloadtime.mattrude.com-611bee7dfb28ce68044ba062fa3e012ba1b19829.tar.gz
time.mattrude.com-611bee7dfb28ce68044ba062fa3e012ba1b19829.tar.bz2
time.mattrude.com-611bee7dfb28ce68044ba062fa3e012ba1b19829.zip
renamed: do-build-site -> build-site.sh
Diffstat (limited to 'scripts/build-site.sh')
-rwxr-xr-xscripts/build-site.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/scripts/build-site.sh b/scripts/build-site.sh
new file mode 100755
index 0000000..b4710f0
--- /dev/null
+++ b/scripts/build-site.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+ROOT=/var/www/time.mattrude.com
+POOLPAGE=$ROOT/status
+TEMPLATESDIR=$ROOT/scripts/templates
+DOCUMENTSDIR=$ROOT/documentation
+
+
+### Building the README Page ###
+
+cd $ROOT
+rm -f $ROOT/readme.tmp $TEMPLATESDIR/readme.html
+markdown $ROOT/README.md > $ROOT/readme.tmp
+cat $TEMPLATESDIR/head > $DOCUMENTSDIR/readme.html
+echo " <div id="title">
+ <h1>time.mattrude.com <i>&mdash; Readme File</i></h1>
+ </div>
+ <p> <a href="/">time.mattrude.com</a> / <a href="/documentation/">documentation</a> / <strong>readme</strong> / </p>" >> $DOCUMENTSDIR/readme.html
+cat $ROOT/readme.tmp $TEMPLATESDIR/tail >> $DOCUMENTSDIR/readme.html
+rm -f $ROOT/readme.tmp
+
+
+### Building the Status Pages ###
+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/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/tail > $X/index.html
+ rm -f out.template
+ for a in clients offset jitter frequency sjit cjit wander disp
+ do
+ mkdir -p $POOLPAGE/$X/$a
+ cat /dev/null > out.template
+ sed -e s/POOL/$X/g $TEMPLATESDIR/template-by-type |sed -e s/TYPE/$a/g >> out.template
+ sync
+ cat out.template $TEMPLATESDIR/tail > $X/$a/index.html
+ rm -f out.template
+ done
+done
+chown -R apache:apache $POOLPAGE