diff --git a/ci/registry_cleanup.sh b/ci/registry_cleanup.sh
index 6ce7dd65ad3c8d9bc8c45e88400ff0be61a5fcb6..6993ec9300cae8634defadee844d1891c46c9f93 100755
--- a/ci/registry_cleanup.sh
+++ b/ci/registry_cleanup.sh
@@ -3,7 +3,7 @@
PROJECT_NAME="cspp_geo%2Fcspp-geo-web-viewer"
PROJ_URL="${CI_API_V4_URL}/projects/${PROJECT_NAME}"
registries_json=$(curl -H "PRIVATE_TOKEN: ${CI_JOB_TOKEN}" "${PROJ_URL}/registry/repositories")
-if [[ $? -eq 0 ]]; then
+if [[ $? -ne 0 ]]; then
echo "Could not download list of container registries"
exit 1
fi