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