-
Notifications
You must be signed in to change notification settings - Fork 0
/
notebookUninstall.sh
executable file
·54 lines (32 loc) · 1.47 KB
/
notebookUninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
CD=/Volumes/CasperShare/Scripts/CocoaDialog.app/Contents/MacOS/CocoaDialog
notebook=$(defaults read /Applications/SMART\ Technologies/Notebook.app/Contents/Info | awk '/CFBundleVersion/ {print}' | cut -f2 -d = | tr -d \'\"\;)
#Checks if SMART Notebook is installed.
function uninstallNotebook()
{
#Uninstall SMART Notebook
#Checks for running SMART Products and/or services
procID=$(ps -ef | awk '/SMART Technologies/ {print $2}' | sed '$d')
#Provides dialog box for end-user to confirm uninstall
prompt=$("$CD" msgbox --title "Confirm Uninstall" --text "You are about to remove SMART Notebook $notebook from your Mac." --informative-text "Press 'Confirm' to continue, otherwise Cancel." --icon-file ~/Desktop/notebook-trash.png --width 515 --height 120 --button1 "Confirm" --button2 "Cancel" --string-output)
if [[ $prompt == "Confirm" ]] && [[ -d /Applications/SMART\ Technologies ]]; then
echo "Killing SMART processes and applications..."
for id in $procID
do
kill -9 $id
done
echo -n "SMART Processes Terminated"
echo "Uninstalling SMART files..."
rm -r "/Applications/SMART Technologies"
rm -r "/Library/Application Support/SMART Technologies"
rm -r /Library/Preferences/com.smarttech.settings.plist
echo "Uninstallation Complete."
else
exit 0
fi
}
if [[ -d /Applications/SMART\ Technologies ]];then
uninstallNotebook
else
exit 0
fi