diff --git a/coin/provisioning/common/macos/disable_spotlight.sh b/coin/provisioning/common/macos/disable_spotlight.sh index b4907ca0..bc3a2c85 100755 --- a/coin/provisioning/common/macos/disable_spotlight.sh +++ b/coin/provisioning/common/macos/disable_spotlight.sh @@ -2,14 +2,17 @@ # Copyright (C) 2017 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +# Allow retry in case mdutil fails with first tries +set +e + disableSpotlight() { # Disable spotlight and and stop indexing - sudo mdutil -a -i off - sudo mdutil -a -i off / + sudo mdutil -a -i off || return 1 + sudo mdutil -a -i off / || return 1 # Disable spotlight indexing /Volumes - sudo mdutil -i off /Volumes + sudo mdutil -i off /Volumes || return 1 # Erase spotlight index - sudo mdutil -E / + sudo mdutil -E / || return 1 } # Disabling spotlight tends to be flaky, add some retry