]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - debian/postinst
implemented upgradehooksh
[git.ikiwiki.info.git] / debian / postinst
1 #!/bin/sh
2 set -e
3 #DEBHELPER#
5 wikilist=/etc/ikiwiki/wikilist
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 }
24 if [ "$1" = configure ] && [ -e $wikilist ]; then
25         grep -v '^#' $wikilist | grep -v '^$' | while read line; do 
26                 processline $line
27         done
28 fi