ansible-roles/nagios-nrpe/files/check-local_completion
William Hirigoyen 6ab34517b6
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2781|5|2776|5|:-1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/249//ansiblelint">Evolix » ansible-roles » unstable #249</a>
gitea/ansible-roles/pipeline/head This commit looks good
nagios-nrpe: add a NRPE check-local command with completion
2023-05-12 12:35:49 +02:00

14 lines
459 B
Bash

#!/usr/bin/env bash
_check_local_dynamic_completion() {
local cur;
cur=${COMP_WORDS[COMP_CWORD]};
check_list=$(grep 'check_' /etc/nagios/nrpe.d/evolix.cfg | grep -vE '^[[:blank:]]*#' | awk -F'[\[\]=_]' '{print $3}')
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