47 lines
1013 B
Bash
47 lines
1013 B
Bash
#!/bin/sh
|
|
|
|
set -e # xplode on failures
|
|
|
|
. util.sh
|
|
|
|
helpers.help(){
|
|
echo "This script upgrades all packages for host and jails defined in config.sh"
|
|
echo "This script takes no parameters."
|
|
}
|
|
|
|
helpers.checkhelp $1
|
|
|
|
echo "Loading config."
|
|
. config.sh
|
|
|
|
echo "Updating host packages…"
|
|
set -x
|
|
pkg upgrade -y
|
|
set +x
|
|
echo "Done!"
|
|
echo "NOTICE:"
|
|
echo " This script will NOT automatically restart services on the host."
|
|
echo " If any running services were updated, it is *your* responsibility"
|
|
echo " to restart them to make sure they actually run the updated version."
|
|
|
|
if [ "$config_jails" ]
|
|
then
|
|
echo "Updating packages for jails…"
|
|
for jail in $config_jails
|
|
do
|
|
echo "$jail"
|
|
set -x
|
|
pkg -j $jail upgrade -y
|
|
set +x
|
|
echo "Done."
|
|
done
|
|
echo "Restarting affected jails."
|
|
echo "(making sure updated services actually run the updated versions)"
|
|
set -x
|
|
service jail restart $config_jails
|
|
set +x
|
|
echo "Done."
|
|
fi
|
|
|
|
echo "All Done!"
|