check for dig and adjusts dependency check logic (#457)

This commit is contained in:
yubiuser
2025-04-04 22:38:26 +02:00
committed by GitHub
2 changed files with 24 additions and 3 deletions

22
padd.sh
View File

@@ -1517,15 +1517,31 @@ secretRead() {
}
check_dependencies() {
local hasDeps=true
# Check for required dependencies
if ! command -v curl >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'curl' is missing but required.\n"
exit 1
hasDeps=false
fi
if ! command -v jq >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
exit 1
printf "%b" "${check_box_bad} Error!\n 'jq' is missing but required.\n"
hasDeps=false
fi
if ! command -v dig >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'dig' is missing but required.\n"
hasDeps=false
fi
if ! command -v tput >/dev/null 2>&1; then
printf "%b" "${check_box_bad} Error!\n 'tput' is missing but required.\n"
hasDeps=false
fi
if ! [ "${hasDeps}" = true ]; then
printf "%b" "\n Please install the missing dependencies noted above.\n"
exit 1
fi
}