FreeBSD jail upgrade script
I wrote a little script today to assist me when upgrading my jails on my FreeBSD box. Remember that you need to have done the usual build world and build kernel before running this to get the new changes into your jails. I never have my jails running while updating them, so blame yourself if you screw something up. It’s nothing fancy though, but I use it without trouble.
#!/usr/local/bin/bash
JAILS=/home/jails
cd /usr/src
for jail in `ls ${JAILS}`; do
mergemaster -pD ${JAILS}/${jail}
make installworld DESTDIR=${JAILS}/${jail}
mergemaster -iD ${JAILS}/${jail}
done