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