From 2650ad9f360e1ecea9d1f396886909a95f2b52c1 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 3 Jun 2008 12:05:01 +0000 Subject: New script to refresh multipart ikiwiki sites needing aggregation. --- localikiwikirefreshsite | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 localikiwikirefreshsite diff --git a/localikiwikirefreshsite b/localikiwikirefreshsite new file mode 100755 index 0000000..fdb3773 --- /dev/null +++ b/localikiwikirefreshsite @@ -0,0 +1,66 @@ +#!/bin/sh +# +# /usr/local/bin/localikiwikirefreshsite +# Copyright 2008 Jonas Smedegaard +# +# $Id: localikiwikirefreshsite,v 1.1 2008-06-03 12:05:01 jonas Exp $ +# +# Refresh multipart ikiwiki site, aggregating only main part +# + +set -e + +PRG=$(basename "$0") + +TEMP=$(getopt -s sh -o h -l help -n "$PRG" -- "$@") +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi +eval set -- "$TEMP" + +showhelp() { + cat <&2 "Error: $1" + echo >&2 "Exiting..." + exit 1 +} + +ikiwikirefresh() { + part="$1" + shift || exit1 "Internal error: part not supplied!" + + case "$part" in + ""|.) cfgpath=$CFGDIR/ikiwiki.setup;; + *) cfgpath=$CFGDIR/ikiwiki.$part.setup;; + esac + ikiwiki --setup $cfgpath "$@" +} + +while true ; do + case "$1" in + -h|--help) showhelp; exit 0;; + --) shift; break;; + *) exit1 "Internal error!";; + esac +done + +project="$1" +[ -n "$project" ] || exit1 "Project name must be supplied!" +shift + +mainpart="$1" +shift || exit1 "Main part must be supplied (use \"\" if unnamed)!" + +CFGDIR=~/private_webdata/$project + +ikiwikirefresh "$mainpart" --aggregate --refresh +for part in "$@"; do + ikiwikirefresh "$part" --refresh +done -- cgit v1.2.3