1
0
Fork 0
forked from mirrors/openup

Warn the user if the machine did not reboot after the last kernel update.

This commit is contained in:
Antoine Jacoutot 2013-09-30 16:55:16 +02:00
commit 9a718fbace

16
openup
View file

@ -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-*