Test if ldapsearch is available
This commit is contained in:
parent
29e64cc35d
commit
1781803123
|
@ -183,10 +183,37 @@ is_var_empty_silent() { # {{{
|
||||||
|
|
||||||
return "${return_var_empty_silent}"
|
return "${return_var_empty_silent}"
|
||||||
|
|
||||||
|
}
|
||||||
|
# }}}
|
||||||
|
is_command_available() { # {{{
|
||||||
|
|
||||||
|
local_command_available_cmd="${1}"
|
||||||
|
|
||||||
|
## Return False by default
|
||||||
|
return_command_available="1"
|
||||||
|
|
||||||
|
if [ "$(command -v ${local_command_available_cmd})" ]; then
|
||||||
|
debug_message "is_command_available − \
|
||||||
|
${RED}${local_command_available_cmd}${COLOR_DEBUG} seems present on this host."
|
||||||
|
return_command_available="0"
|
||||||
|
else
|
||||||
|
debug_message "is_command_available − \
|
||||||
|
${RED}${local_command_available_cmd}${COLOR_DEBUG} is not available on this host."
|
||||||
|
return_command_available="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
return "${return_command_available}"
|
||||||
|
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
main() { # {{{
|
main() { # {{{
|
||||||
|
|
||||||
|
## If ldapsearch command is not available {{{
|
||||||
|
### exit with message and error
|
||||||
|
is_command_available "ldapsearch" \
|
||||||
|
|| error_message "ldapsearch command doesn't seems to be available. Please install ldap-utils package." "3"
|
||||||
|
## }}}
|
||||||
|
|
||||||
## Define all vars
|
## Define all vars
|
||||||
define_vars
|
define_vars
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue