From ae186119bed0fa53322f681511b45492897da3df Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Fri, 8 Jul 2022 10:40:48 +0200 Subject: [PATCH] Fix invoking confirm-identified-developers.scpt script (#5876) --- images/macos/provision/core/commonutils.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index daa06627..3519e9c1 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -19,6 +19,22 @@ done # Execute AppleScript to change security preferences for virtualbox # System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now if is_Monterey; then + if is_Veertu; then + retry=10 + while [ $retry -gt 0 ]; do + { + osascript -e 'tell application "System Events" to get application processes where visible is true' + } && break + + retry=$((retry-1)) + if [ $retry -eq 0 ]; then + echo "No retry attempts left" + exit 1 + fi + sleep 10 + done + fi + osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD fi