]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - ikiwiki-mass-rebuild
web commit by http://joey.kitenet.net/
[git.ikiwiki.info.git] / ikiwiki-mass-rebuild
1 #!/bin/sh
2 set -e
4 action="$@"
6 wikilist=/etc/ikiwiki/wikilist
8 processline () {
9         user="$1"
10         setup="$2"
11         
12         if [ -z "$user" ] || [ -z "$setup" ]; then
13                 echo "parse failure in /etc/ikiwiki/wikilist, line: '$user $setup'" >&2
14                 exit 1
15         fi
16         
17         if [ ! -f "$setup" ]; then
18                 echo "warning: $setup specified in /etc/ikiwiki/wikilist does not exist, skipping" >&2
19         else
20                 echo "Processing $setup as user $user ..."
21                 su "$user" -c "ikiwiki -setup $setup $action"
22         fi
23 }
25 if [ -e "$wikilist" ]; then
26         grep -v '^#' $wikilist | grep -v '^$' | while read line; do 
27                 processline $line
28         done
29 fi