Bash-confirm-binaries: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=== Simple function to confirm binaries exist before running scripts === <pre> #=== FUNCTION ================================================================ # NAME: verify_deps # DESCRIPTION: Check that all binary files are available to be used # PARAMETERS: None. This is standalone. Changes occur on case by case # RETURNS: none #=============================================================================== verify_deps() { # needed="xmllint...") |
(No difference)
|
Revision as of 07:40, 23 March 2023
Simple function to confirm binaries exist before running scripts
#=== FUNCTION ================================================================
# NAME: verify_deps
# DESCRIPTION: Check that all binary files are available to be used
# PARAMETERS: None. This is standalone. Changes occur on case by case
# RETURNS: none
#===============================================================================
verify_deps() {
# needed="xmllint curl w3m snmptrap cut egrep expr"
needed="ansible ansible-playbook grep sed echo tee"
for i in `echo $needed`
do
type $i >/dev/null 2>&1
if [ $? -eq 1 ]; then
echo "Status WARNING - missing manditory component: $i"; exit 1
fi
done
echo "Confirmed: all binary files necessary have been found"
}