Update FreeBSD and Ports with portmaster

Recent talks on FreeBSD-Ports lists have been about whether portupgrade should be shown the door, portmaster seems to be the new way to go.

http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/068887.html

I still quite like portupgrade for some reasons but I would rather play it safe and jump on to portmaster before portupgrade sinks. In an old post I gave an example shell script that would run and bunch of stuff to update FreeBSD, in that script I used portupgade, this is the revised script using portmaster.

First make sure you have the following installed

#!/bin/sh

LOG_FILE="/var/log/freebsd-update.log"

echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo "***"
echo "*** Updating ports tree..."
echo "***"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo "***"
echo "*** Looking for ports to update..."
echo "***"
/usr/local/sbin/portmaster -a --no-confirm | tee -a ${LOG_FILE}

echo "***"
echo "*** Checking installed ports for known security problems..."
echo "***"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}

You may also like...