-if [[ -f "${defaultconfig}" ]]; then
- source "${defaultconfig}"
-else
- "${tools_dir}/msg.sh" -a 'build.sh' error "${defaultconfig} was not found."
- exit 1
-fi
-
-# Load custom.conf
-if [[ -f "${script_path}/custom.conf" ]]; then
- source "${script_path}/custom.conf"
-fi
+[[ ! -f "${defaultconfig}" ]] && "${tools_dir}/msg.sh" -a 'build.sh' error "${defaultconfig} was not found." && exit 1
+for config in "${defaultconfig}" "${script_path}/custom.conf"; do
+ [[ -f "${script_path}/${config}.conf" ]] && source "${script_path}/${config}.conf"
+done