diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 5fe6e7d88ec6043fc8531eb9ab3699c577a0a0da..ae1c8ebcd77922668dc4d029bc9dfd272a42d7b0 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -4,9 +4,9 @@ set -Eeo pipefail
 mkdir /seafile-data
 seaf-cli init -d /seafile-data
 if [ -z "$OTP_TOKEN" ]; then
-  seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD" --tfa $(oathtool --totp -b "$OTP_TOKEN")
-else
   seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD"
+else
+  seaf-cli sync -l "$LIBRARY" -s "$SERVER" -d "/sync" -u "$EMAIL" -p "$PASSWORD" --tfa $(oathtool --totp -b "$OTP_TOKEN")
 fi
 seaf-cli start