]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - ikiwiki-mass-rebuild
* Add -refresh option to ikiwiki-mass-rebuild and use that on upgrades that
[git.ikiwiki.info.git] / ikiwiki-mass-rebuild
1 #!/bin/sh
2 set -e
4 action=""
5 if [ -n "$1" ]; then
6         action="$1"
7 fi
9 wikilist=/etc/ikiwiki/wikilist
11 processline () {
12         user="$1"
13         setup="$2"
14         
15         if [ -z "$user" ] || [ -z "$setup" ]; then
16                 echo "parse failure in /etc/ikiwiki/wikilist, line: '$user $setup'" >&2
17                 exit 1
18         fi
19         
20         if [ ! -f "$setup" ]; then
21                 echo "warning: $setup specified in /etc/ikiwiki/wikilist does not exist, skipping" >&2
22         else
23                 echo "Processing $setup as user $user ..."
24                 su "$user" -c "ikiwiki -setup $setup $action"
25         fi
26 }
28 if [ -e "$wikilist" ]; then
29         grep -v '^#' $wikilist | grep -v '^$' | while read line; do 
30                 processline $line
31         done
32 fi