Make backend checking actually work properly

This commit is contained in:
Salt 2019-09-26 14:44:36 -05:00
parent d9e4479766
commit 3883f54cdb

11
ptgdp
View File

@ -104,12 +104,15 @@ main() {
done < "$_optconfigfile"
fi
# Validate critical options
{
(
for backend in ${_supportedbackends[@]}; do
[ "$backend" = "${_config[backend]}" ] && return 0
if [ "$backend" = "${_config[backend]}" ]; then
return 0
fi
done
error "Unsupported backend: ${_config[backend]}" 50
}
return 1
) || error "Unsupported backend: ${_config[backend]}" 50
# Pre-really-do-stuff hooks like help text
[ -n "$_opthelp" ] && printhelp && exit 0