You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
714 B

4 years ago
#!/bin/sh -eux
# Unset these as if they're empty it'll break freebsd-update
[ -z "$no_proxy" ] && unset no_proxy
[ -z "$http_proxy" ] && unset http_proxy
[ -z "$https_proxy" ] && unset https_proxy
freebsd_update="/usr/sbin/freebsd-update --not-running-from-cron";
# Update FreeBSD
# NOTE: the install action fails if there are no updates so || true it
env PAGER=/bin/cat $freebsd_update fetch || true;
env PAGER=/bin/cat $freebsd_update install || true;
if [ "$pkg_branch" != "quarterly" ]; then
sed -i.bak -e "s,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/${pkg_branch}," /etc/pkg/FreeBSD.conf
rm -f /etc/pkg/FreeBSD.conf.bak
fi
env ASSUME_ALWAYS_YES=true pkg update;