diff --git a/kdumpctl b/kdumpctl index fb5b35a..503e44e 100755 --- a/kdumpctl +++ b/kdumpctl @@ -532,28 +532,22 @@ check_fs_modified() check_system_modified() { local ret + local CONF_ERROR=2 + local CONF_MODIFY=1 + local CONF_NO_MODIFY=0 + local conf_status=$CONF_NO_MODIFY [[ -f $TARGET_INITRD ]] || return 1 - check_files_modified - ret=$? - if [[ $ret -ne 0 ]]; then - return $ret - fi - - check_fs_modified - ret=$? - if [[ $ret -ne 0 ]]; then - return $ret - fi - - check_drivers_modified - ret=$? - if [[ $ret -ne 0 ]]; then - return $ret - fi + for _func in check_files_modified check_fs_modified check_drivers_modified; do + $_func + ret=$? + # return immediately if an error occurred. + [[ $ret -eq "$CONF_ERROR" ]] && return "$ret" + [[ $ret -eq "$CONF_MODIFY" ]] && { conf_status="$CONF_MODIFY"; } + done - return 0 + return $conf_status } check_rebuild()