This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
removeLoanShark.sh
executable file
·67 lines (56 loc) · 1.73 KB
/
removeLoanShark.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
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#####################
# LoanShark Uninstall
# -----------------------
# This script will remove all components of LoanShark, and unload the Daemon associated with LoanShark
#####################
# LoanShark Files
preferences="/Library/Preferences/com.github.cybertunnel.LoanShark.plist"
loan_period_preference="com.github.cybertunnel.LoanShark.plist"
launch_daemon="/Library/LaunchDaemons/com.github.cybertunnel.LoanShark.launch.plist"
old_launch_daemon="/Library/LaunchDaemons/com.github.cybertunnel.launch.plist"
app_folder="/Library/Application Support/LoanShark"
app_name="LoanShark"
# Commands
rm="rm"
launchctl="/bin/launchctl"
find="/usr/bin/find"
echo="/bin/echo"
killall="/usr/bin/killall"
$echo "Unloading LaunchDaemon..."
if [ -f ${launch_daemon} ]; then
$launchctl bootout system ${launch_daemon}
elif [ -f ${old_launch_daemon} ]; then
$echo "Old LaunchDaemon found!"
$launchctl bootout system ${old_launch_daemon}
else
$echo "No known LaunchDaemon was found, skipping..."
fi
$echo "Killing LoanShark process(es)..."
$killall ${app_name}
$echo "Deleting LoanShark files..."
if [[ -f ${launch_daemon} || -f ${old_launch_daemon} ]]; then
$echo "LaunchDaemon..."
if [ -f ${launch_daemon} ]; then
$rm ${launch_daemon}
else
$rm ${old_launch_daemon}
fi
else
$echo "No LaunchDaemon found!"
fi
if [ -f ${preferences} ]; then
$echo "Preferences..."
$rm ${preferences}
else
$echo "No preferences found!"
fi
if [ -d ${app_folder} ]; then
$echo "LoanShark application folder..."
$rm -r ${app_folder}
else
$echo "No LoanShark application folder found!"
fi
$echo "Removing any loan period preferences..."
$find "/Users/" -name ${loan_period_preference} -delete
exit 0