diff --git a/distribution/macos/updater.sh b/distribution/macos/updater.sh
index 85d4f4926f..e0f3a44709 100755
--- a/distribution/macos/updater.sh
+++ b/distribution/macos/updater.sh
@@ -33,9 +33,9 @@ trap 'error_handler ${LINENO}' ERR
 # After the third time checking, this script exits with status 1
 
 attempt=0
-while [ attempt -lt 3 ]; do
+do
     if lsof -p $APP_PID +r 1 &>/dev/null; then
-        if [ attempt -eq 2 ]; then
+        if [ $attempt -eq 2 ]; then
             exit 1
         fi
         sleep 1