Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

check_glusterfs: line 162: [: ==: unary operator expected #15

@project707

Description

@project707

If you have an error like "unsynched entries" none of the cases that set ex_stat are hit. This means that you then have an unquoted ${ex_stat} as there is on line 162 (the last line shown here):

# exit with warning if errors
if [ -n "$errors" ]; then
	sep='; '
	msg=$(printf "${sep}%s" "${errors[@]}")
	msg=${msg:${#sep}}
	if [ ${ex_stat} == "CRITICAL_stat" ]; then

then the variable is just empty and the warning is produced. I think it just needs to be quoted to fix this to stop the warning from being produced, e.g.:

	if [ "${ex_stat}" == "CRITICAL_stat" ]; then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions