From 2d910c0bf182efd0c69ec0997c4060a71db89fe3 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Wed, 11 Mar 2020 15:38:48 +0100 Subject: [PATCH] updated TeamID parsing --- Installomator.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 57603ae..aefaef6 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -184,7 +184,7 @@ case $identifier in downloadURL="https://downloads.malwarebytes.com/file/mb3-mac" expectedTeamID="GVZRY6KDKR" ;; - suspiciouspackage) + suspiciouspackage) # thanks Mischa van der Bent         name="Suspicious Package"         type="dmg"         downloadURL="https://mothersruin.com/software/downloads/SuspiciousPackage.dmg" @@ -403,14 +403,14 @@ installFromDMG() { # verify with spctl echo "Verifying: $dmgmount/$appName" - if ! teamID=$(spctl -a -vv "$dmgmount/$appName" 2>&1 | awk '/origin=/ {print $NF }' ); then + if ! teamID=$(spctl -a -vv "$dmgmount/$appName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then echo "Error verifying $dmgmount/$appName" cleanupAndExit 4 fi echo "Team ID: $teamID (expected: $expectedTeamID )" - if [ "($expectedTeamID)" != "$teamID" ]; then + if [ "$expectedTeamID" != "$teamID" ]; then echo "Team IDs do not match!" cleanupAndExit 5 fi @@ -453,14 +453,14 @@ installFromDMG() { installFromPKG() { # verify with spctl echo "Verifying: $archiveName" - if ! teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' ); then + if ! teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then echo "Error verifying $archiveName" cleanupAndExit 4 fi echo "Team ID: $teamID (expected: $expectedTeamID )" - if [ "($expectedTeamID)" != "$teamID" ]; then + if [ "$expectedTeamID" != "$teamID" ]; then echo "Team IDs do not match!" cleanupAndExit 5 fi