diff --git a/openup b/openup index 9d90ee5..8b74d73 100755 --- a/openup +++ b/openup @@ -37,7 +37,7 @@ VUXML_URL="https://stable.mtier.org/vuxml/$(uname -r | tr -d '.').xml" ######################################################################## -_OPENUP_VERSION=11 +_OPENUP_VERSION=12 _OPENUP_MINREL=53 usage() { @@ -230,6 +230,18 @@ check_vuxml() { done | fmt | sed '/^$/d' } +do_i_need_to_reboot() { + # XXX hardcoded PKG_DBDIR + local kern_bp_time=$(stat -f "%Um" /var/db/pkg/binpatch${_REL_INT}-${_ARCH}-kernel-*) + local wake_up=$(sysctl -n kern.boottime) + + if [ "${wake_up}" -lt "${kern_bp_time}" ]; then + pr_error + pr_error "System must be rebooted after the last kernel update" + pr_error + fi +} + while getopts 'KScn' arg; do case ${arg} in K) exclude_kernel=1 ;; @@ -258,4 +270,6 @@ else update_pkg fi +do_i_need_to_reboot + rm -f ${_TMPDIR}/.openup-*