local module_check
module_check(){
- if [[ ! "$(bash "${tools_dir}/module.sh" check "${1}")" = "correct" ]]; then
+ msg_debug "Checking ${1} module ..."
+ if ! bash "${tools_dir}/module.sh" check "${1}"; then
msg_error "Module ${1} is not available." "1";
fi
}
echo " General options:"
echo " -v | --version [ver] Specifies the AlterISO version"
echo " -h | --help This help message"
+ echo
+ echo " check exit code:"
+ echo " 0 (correct) 1 (incorrect) 2 (other)"
}
check(){
if (( "${#}" == 0 )) || (( "${#}" >= 2 ));then
_help
- exit 1
+ exit 2
fi
local _version
if [[ -f "${module_dir}/${1}/alteriso" ]]; then
unset alteriso
)"
if (( "$(echo "${_version}" | cut -d "." -f 1)" == "$(echo "${alteriso_version}" | cut -d "." -f 1)" )); then
- echo "correct"
+ exit 0
fi
else
- echo "incorrect"
+ exit 1
fi
}