-
-
Save rtrouton/8b53adb27a9c366365a7845a39cc072a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Description: Script to uninstall NexThink Collector. | |
ERROR=0 | |
# File Paths | |
if [[ -f "$(/usr/bin/find $(dirname $0) -maxdepth 1 \( -iname \*\.dmg \))" ]]; then | |
dmgFile="$(/usr/bin/find $(dirname $0) -maxdepth 1 \( -iname \*\.dmg \))" | |
fi | |
dmgMount="$(/usr/bin/mktemp -d /tmp/NexThink_Collector_Uninstaller.XXXX)" | |
# Remove the trailing slash from the dmgMount variable if needed. | |
dmgMount=${dmgMount%%/} | |
# Mount the DMG | |
/usr/bin/hdiutil attach "$dmgFile" -mountpoint "$dmgMount" -nobrowse -noverify -noautoopen | |
# Uninstall the NexThink Collector software | |
"$dmgMount"/uninstaller | |
# Unmount the DMG | |
hdiutil detach $dmgMount -force | |
exit $ERROR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment