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