summaryrefslogtreecommitdiff
path: root/ikiwiki-mass-rebuild
blob: 7ec41e98f7734db9b132e139c475ac44e869a6f7 (plain)
  1. #!/bin/sh
  2. set -e
  3. action="$@"
  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 "Processing $setup as user $user ..."
  16. su "$user" -c "ikiwiki -setup $setup $action"
  17. fi
  18. }
  19. if [ -e "$wikilist" ]; then
  20. grep -v '^#' $wikilist | grep -v '^$' | while read line; do
  21. processline $line
  22. done
  23. fi