ansible-roles/nagios-nrpe/files/check-local_completion
William Hirigoyen 5563b4f8f2
Some checks failed
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2786|2|2784|1|:-1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/256//ansiblelint">Evolix » ansible-roles » unstable #256</a>
gitea/ansible-roles/pipeline/head There was a failure building this commit
nagios-nrpe: improve check-local output and fix completion in Debian 10
2023-05-25 16:01:04 +02:00

13 lines
341 B
Bash

#!/usr/bin/env bash
_check_local_dynamic_completion() {
local cur;
cur=${COMP_WORDS[COMP_CWORD]};
COMPREPLY=();
COMPREPLY=( $( compgen -W '$(grep check_ /etc/nagios/nrpe.d/evolix.cfg | grep -vE "^[[:blank:]]*#" | awk -F"[\\\[\\\]=_]" "{print \$3}")' -- $cur ) );
}
complete -F _check_local_dynamic_completion check-local