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