diff --git a/neon/build.sh b/neon/build.sh
index a67b9e5968d294b70c0d17742027ed20350f6c34..e0789be524b2e270d64c885868262b7e5650da55 100755
--- a/neon/build.sh
+++ b/neon/build.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
 
 if [ -z "${DUNITER_FAST_BUILD}" ]; then
-    if [ -e "${HOME}/.cargo/bin/rustup" ]; then
+    if [ "$(command -v rustup)" ]; then
         rustup update stable
-    else
+    elif [ ! "$(command -v cargo)" ]; then
         curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
         export PATH="$HOME/.cargo/bin:$PATH"
     fi