#!/bin/sh set -e for i in $(find /etc/ikiwiki/piny/* -maxdepth 0 -type f -iname '*.setup' -printf "%f\n" | perl -pe 's/.setup$//'); do echo Rebuilding $i... sudo sudo rebuildrepo $i; # two sudos needed to clear out $SUDO_USER done