diff --git a/Software/Avast/uninstall_Avast.sh b/Software/Avast/Uninstall-Avast.sh similarity index 77% rename from Software/Avast/uninstall_Avast.sh rename to Software/Avast/Uninstall-Avast.sh index 1899eef..3d42cd5 100644 --- a/Software/Avast/uninstall_Avast.sh +++ b/Software/Avast/Uninstall-Avast.sh @@ -3,7 +3,7 @@ ################################################################################################### # Script Name: uninstall_Avast.sh # By: Zack Thompson / Created: 8/16/2019 -# Version: 1.3.0 / Updated: 1/24/2020 / By: ZT +# Version: 1.4.0 / Updated: 5/12/2022 / By: ZT # # Description: Uninstalls Avast using the built in uninstall script. # @@ -23,7 +23,7 @@ echo "Searching for existing Avast instances..." appPaths=$( /usr/bin/find -E /Applications "/Users/${currentUser}" -iregex ".*[/]Avast[.]app" -type d -prune 2>&1 | /usr/bin/grep -v "Operation not permitted" ) -while IFS="\n" read -r appPath; do +while IFS=$'\n' read -r appPath; do echo "Checking path: ${appPath}" # Verify Avast exists in the expected location @@ -38,20 +38,28 @@ while IFS="\n" read -r appPath; do "11" | "12" ) "/Library/Application Support/Avast/components/uninstall/com.avast.uninstall.app/Contents/Resources/uninstall.sh" ;; - "13" | "14" ) + # "13" | "14" ) + # if [[ -e "${appPath}/Contents/Backend/utils/com.avast.uninstall.app/Contents/Resources/uninstall.sh" ]]; then + # "${appPath}/Contents/Backend/utils/com.avast.uninstall.app/Contents/Resources/uninstall.sh" + # elif [[ -e "${appPath}/Contents/Backend/hub/uninstall.sh" ]]; then + # "${appPath}/Contents/Backend/hub/uninstall.sh" + # fi + # ;; + * ) if [[ -e "${appPath}/Contents/Backend/utils/com.avast.uninstall.app/Contents/Resources/uninstall.sh" ]]; then "${appPath}/Contents/Backend/utils/com.avast.uninstall.app/Contents/Resources/uninstall.sh" elif [[ -e "${appPath}/Contents/Backend/hub/uninstall.sh" ]]; then "${appPath}/Contents/Backend/hub/uninstall.sh" + else + echo "ERROR: Unable to uninstall this version!" + continue fi ;; - * ) - echo "ERROR: Unable to uninstall this version!" - continue - ;; esac - if [[ $? = 0 ]]; then + exit_code=$? + + if [[ $exit_code == "0" ]]; then echo " -> Success" successfulExit="0" else @@ -66,7 +74,7 @@ while IFS="\n" read -r appPath; do done < <(echo "${appPaths}") -if [[ "${successfulExit}" != "" ]]; then +if [[ "${successfulExit}" == "0" ]]; then echo "***** Uninstall Avast process: COMPLETE *****" # If Avast was uninstalled successfully, then run a recon "${jamfBin}" recon