2018-12-03 08:41:12 +00:00
|
|
|
#!/bin/bash
|
2018-12-03 14:22:12 +00:00
|
|
|
set -euo pipefail
|
2018-12-03 08:41:12 +00:00
|
|
|
|
2018-12-05 11:17:45 +00:00
|
|
|
req_restart_prefix=(
|
2018-12-11 16:00:04 +00:00
|
|
|
glibc
|
2018-12-05 11:17:45 +00:00
|
|
|
linux
|
|
|
|
systemd
|
|
|
|
)
|
2018-12-03 08:41:12 +00:00
|
|
|
|
2018-12-05 11:17:45 +00:00
|
|
|
function get_grep() {
|
|
|
|
local IFS_bak="${IFS}"
|
|
|
|
IFS="|"
|
|
|
|
echo "${req_restart_prefix[*]}"
|
|
|
|
IFS="${IFS_bak}"
|
|
|
|
}
|
|
|
|
|
|
|
|
updates=$(checkupdates)
|
|
|
|
|
2018-12-07 15:05:53 +00:00
|
|
|
num=$(echo "${updates}" | grep -c -- '->')
|
2018-12-05 11:17:45 +00:00
|
|
|
|
|
|
|
req_restart=""
|
|
|
|
echo "${updates}" | grep -qE "^($(get_grep)) " && req_restart=' <span color="#dd0000">(reboot)</span>'
|
|
|
|
|
|
|
|
printf "\uf94f %d %s%s" $num $(${HOME}/bin/pluralize Update $num) "${req_restart}"
|