forked from mirrors/openup
Warn the user if the machine did not reboot after the last kernel update.
This commit is contained in:
parent
4e350bab9f
commit
9a718fbace
1 changed files with 15 additions and 1 deletions
16
openup
16
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-*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue