From f5c1d69efccddda9d3edab3d454736e6276d66ee Mon Sep 17 00:00:00 2001 From: Adam Codega Date: Thu, 3 Mar 2022 13:35:53 -0500 Subject: [PATCH] new dialogURL and expectedDialogTeamID variables Updated variables to better avoid conflict with variables used in your scripts --- dialogCheckFunction.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dialogCheckFunction.sh b/dialogCheckFunction.sh index a6efc2f..9edeffc 100644 --- a/dialogCheckFunction.sh +++ b/dialogCheckFunction.sh @@ -2,9 +2,9 @@ function dialogCheck(){ # Get the URL of the latest PKG From the Dialog GitHub repo - url=$(curl --silent --fail "https://api.github.com/repos/bartreardon/Dialog/releases/latest" | awk -F '"' "/browser_download_url/ && /pkg\"/ { print \$4; exit }") + dialogURL=$(curl --silent --fail "https://api.github.com/repos/bartreardon/Dialog/releases/latest" | awk -F '"' "/browser_download_url/ && /pkg\"/ { print \$4; exit }") # Expected Team ID of the downloaded PKG - expectedTeamID="PWA5E9TQ59" + expectedDialogTeamID="PWA5E9TQ59" # Check for Dialog and install if not found if [ ! -e "/Library/Application Support/Dialog/Dialog.app" ]; then @@ -13,11 +13,11 @@ function dialogCheck(){ workDirectory=$( /usr/bin/basename "$0" ) tempDirectory=$( /usr/bin/mktemp -d "/private/tmp/$workDirectory.XXXXXX" ) # Download the installer package - /usr/bin/curl --location --silent "$url" -o "$tempDirectory/Dialog.pkg" + /usr/bin/curl --location --silent "$dialogURL" -o "$tempDirectory/Dialog.pkg" # Verify the download teamID=$(/usr/sbin/spctl -a -vv -t install "$tempDirectory/Dialog.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()') # Install the package if Team ID validates - if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then + if [ "$expectedDialogTeamID" = "$teamID" ] || [ "$expectedDialogTeamID" = "" ]; then /usr/sbin/installer -pkg "$tempDirectory/Dialog.pkg" -target / else # displayAppleScript # uncomment this if you're using my displayAppleScript function