2020-05-26 21:15:31 -07:00
|
|
|
#!/usr/local/bin/bash
|
|
|
|
|
2020-02-25 11:28:31 -08:00
|
|
|
# Copyright (c) 2018-2020, diyIT.org
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
|
|
|
|
# https://diyit.org/license/
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
update_jail ()
|
|
|
|
{
|
|
|
|
echo "######## ## JAIL:::: $JAIL ##"
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
## uncomment below to list and remove snapshots
|
|
|
|
#zfs list -t snapshot -o name | grep ship/iocage/jails/$JAIL | sort
|
|
|
|
#read -p "remove all $JAIL snapshots (y/N)? " RESP
|
|
|
|
#if [ ! -z $RESP ] && [ $RESP == "y" ]; then
|
|
|
|
# zfs list -t snapshot -o name | grep ship/iocage/jails/$JAIL | sort | xargs -n 1 zfs destroy
|
|
|
|
#fi
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
iocage exec $JAIL "freebsd-version"
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
## uncomment below for an upgrade instead of an update
|
|
|
|
#iocage upgrade -r 12.1-RELEASE $JAIL
|
|
|
|
|
|
|
|
iocage update $JAIL
|
|
|
|
|
|
|
|
iocage exec $JAIL "pkg upgrade -f -y"
|
|
|
|
iocage exec $JAIL "mergemaster"
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
iocage exec $JAIL "freebsd-version"
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
iocage exec $JAIL "pkg update -f"
|
|
|
|
iocage exec $JAIL "pkg autoremove -y"
|
|
|
|
iocage exec $JAIL "pkg upgrade -y"
|
|
|
|
iocage exec $JAIL "pkg clean -ay"
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "######## ####"
|
|
|
|
}
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
iocage fetch -U -r 12.1-RELEASE
|
|
|
|
|
|
|
|
read -p "update pkgp jail (y/N)? " RESP
|
|
|
|
if [ ! -z $RESP ] && [ $RESP == "y" ]; then
|
|
|
|
JAIL="pkgp"
|
|
|
|
update_jail
|
|
|
|
fi
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-05-26 21:15:31 -07:00
|
|
|
./jails-update-pkgs.sh pkgp-only
|
2020-02-25 11:28:31 -08:00
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
read -p "update all jails (y/N)? " RESP
|
|
|
|
if [ ! -z $RESP ] && [ $RESP == "y" ]; then
|
|
|
|
for JAIL in `iocage list -h | cut -f2`;
|
|
|
|
do
|
|
|
|
if [ $JAIL == "pkgp" ] || [ $JAIL == "debian"]; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
update_jail
|
|
|
|
done
|
2020-02-25 11:28:31 -08:00
|
|
|
fi
|
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "update base system by running:"
|
|
|
|
echo "freebsd-update fetch"
|
|
|
|
echo "freebsd-update install"
|
2020-05-26 21:15:31 -07:00
|
|
|
echo "cd /usr/src && make -j8 buildkernel KERNCONF=diyIT && make -j8 installkernel KERNCONF=diyIT"
|
|
|
|
echo "reboot"
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "pkg-static upgrade -f"
|
|
|
|
echo "mergemaster"
|