Skip to content

Instantly share code, notes, and snippets.

@dch
Created April 9, 2018 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dch/213054fb36f7d9f8fda6f356f623a8f2 to your computer and use it in GitHub Desktop.
Save dch/213054fb36f7d9f8fda6f356f623a8f2 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
# ansible managed
/bin/freebsd-version -ku
export PAGER="/bin/cat -bu"
cd /etc
test -d .git || git init .
git add -A
git commit --allow-empty -am `freebsd-version -ku | sort -r |head -1`-update
zfs snapshot -r zroot@`date -u +%Y%m%d-%H%M`:`freebsd-version -ku | sort -r |head -1`-update
beadm create `freebsd-version -ku | sort -r |head -1`-update
/usr/sbin/freebsd-update --not-running-from-cron fetch install || /usr/bin/true
echo OK freebsd-update complete
echo OK List Boot Environments
beadm list
echo Now you may sacrifice a goat and reboot.
echo After reboot, re-run "/usr/sbin/-freebsd-update install" if required
echo and "pkg update", then restart daemons as needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment