update cpu checks
This commit is contained in:
@@ -202,6 +202,31 @@ raise SystemExit(1)
|
||||
' 2>/dev/null
|
||||
}
|
||||
|
||||
TAPM_PULSE_RESOURCE_INSTALLED_FROM_CONFIGS() {
|
||||
local nodes_directory="${1:-/etc/pve/nodes}"
|
||||
local config hostname tags
|
||||
local -a configs
|
||||
|
||||
[[ -d "$nodes_directory" ]] || return 2
|
||||
configs=("$nodes_directory"/*/lxc/*.conf)
|
||||
for config in "${configs[@]}"; do
|
||||
[[ -f "$config" ]] || continue
|
||||
hostname="$(
|
||||
awk -F':[[:space:]]*' '$1 == "hostname" { print $2; exit }' "$config"
|
||||
)"
|
||||
tags="$(
|
||||
awk -F':[[:space:]]*' '$1 == "tags" { print $2; exit }' "$config"
|
||||
)"
|
||||
case "$hostname" in
|
||||
[Pp][Uu][Ll][Ss][Ee]|[Pp][Uu][Ll][Ss][Ee]-[Mm][Oo][Nn][Ii][Tt][Oo][Rr])
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
[[ ";${tags};" == *";pulse;"* ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
TAPM_PULSE_PROMPT() {
|
||||
local variable="$1"
|
||||
local label="$2"
|
||||
|
||||
Reference in New Issue
Block a user