Moving all files to basedir
This commit is contained in:
13
kernel_func
Normal file
13
kernel_func
Normal file
@@ -0,0 +1,13 @@
|
||||
kernel_func () {
|
||||
machine_id=$(cat /etc/machine-id)
|
||||
current_kernel=$(uname -r)
|
||||
current_ucode=$(awk -F'[[:space:]]*:[[:space:]]*' '/microcode/ {print $2}' /proc/cpuinfo | uniq)
|
||||
[[ -f /run/next_kernel ]] && next_kernel="$(sudo cat /run/next_kernel)"
|
||||
next_ucode=$(iucode_tool -lqS /lib/firmware/intel-ucode/ | grep -Po 'rev 0x\d+' | tr -d '[rev ]' | tail -1)
|
||||
if [[ "${current_kernel}" == ${next_kernel} ]] && [[ "${current_ucode}" == ${next_ucode} ]] || [[ -z "${next_kernel}" ]]
|
||||
then
|
||||
print -P "[%F{#00ff00}OK%f]"
|
||||
else
|
||||
print -P "[%F{yellow}needs reboot%f]"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user