2023-05-12 12:35:49 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
_check_local_dynamic_completion() {
|
|
|
|
local cur;
|
|
|
|
cur=${COMP_WORDS[COMP_CWORD]};
|
|
|
|
COMPREPLY=();
|
2023-09-15 16:36:57 +02:00
|
|
|
COMPREPLY=( $( compgen -W '$(grep "\[check_" -Rs /etc/nagios/ | grep -vE "^[[:blank:]]*#" | awk -F"[\\\[\\\]=]" "{print \$2}" | sed "s/check_//" | sort | uniq)' -- $cur ) );
|
2023-05-12 12:35:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
complete -F _check_local_dynamic_completion check-local
|
|
|
|
|
|
|
|
|