freebsd-helpers/freebsd-update-postreboot.sh

55 lines
1.1 KiB
Bash

#!/bin/sh
set -e # xplode on failures
. util.sh
helpers.help(){
echo "This finishes a FreeBSD security update after the system has been rebooted."
echo "Make sure you first actually executed freebsd-update.sh and rebooted."
echo "This script takes no parameters."
}
helpers.checkhelp $1
echo "Loading config."
. config.sh
# actually only needed for version upgrades, i.e. TODO: move this into freebsd-upgrade-postreboot.sh
#echo "Finishing host OS update"
#set -x
#freebsd-update install
#set +x
#echo "Done!"
if [ "$config_jails" ]
then
echo "Updating base jail…"
echo "Please make sure that /jail/update has the correct nullfs mounts."
echo "Continue?"
if helpers.yesno
then
set -x
freebsd-update -b /jail/update -F fetch
freebsd-update -b /jail/update install
set +x
echo "Done!"
echo "Restarting jails…"
set -x
service jail restart $config_jails
set -x
fi
fi
echo "Update packages, too?"
if helpers.yesno
then
sh pkg-upgrade.sh
fi
echo "NOTICE:"
echo " You might have to restart your firewall for the restarted jails to be reachable."