mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-02-03 05:53:26 +00:00
v1.0.0 = Initial Version
+ Initial Version
This commit is contained in:
37
Software/Maple/uninstall_Maple.sh
Normal file
37
Software/Maple/uninstall_Maple.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#! /bin/bash
|
||||
|
||||
###################################################################################################
|
||||
# Script Name: uninstall_Maple.sh
|
||||
# By: Zack Thompson / Created: 3/26/2020
|
||||
# Version: 1.0.0 / Updated: 3/26/2020 / By: ZT
|
||||
#
|
||||
# Description: Remove previous version(s) of Maple from /Applications
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
echo "***** Uninstall Maple process: START *****"
|
||||
|
||||
echo "Searching for existing Maple instances..."
|
||||
appPaths=$( /usr/bin/find -E /Applications -iregex ".*[/]Maple [0-9]{4}[.]app" -type d -prune -maxdepth 1 )
|
||||
|
||||
# Verify that a Maple version was found.
|
||||
if [[ -z "${appPaths}" ]]; then
|
||||
echo "Did not find an instance Maple!"
|
||||
|
||||
else
|
||||
# If the machine has multiple Maple Applications, loop through them...
|
||||
while IFS="\n" read -r appPath; do
|
||||
|
||||
# Get the App Bundle name
|
||||
appName=$( echo "${appPath}" | /usr/bin/awk -F "/" '{print $NF}' )
|
||||
|
||||
# Delete the old version
|
||||
echo "Uninstalling: ${appName}"
|
||||
/bin/rm -rf "${appPath}"
|
||||
|
||||
done < <(echo "${appPaths}")
|
||||
fi
|
||||
|
||||
echo "***** Uninstall Maple process: COMPLETE *****"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user