mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-15 07:34:47 -04:00
Add uninstall script to repo
This commit is contained in:
parent
f5273f3f00
commit
43e77dd309
1 changed files with 50 additions and 0 deletions
50
Scripts/uninstall.sh
Executable file
50
Scripts/uninstall.sh
Executable file
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
identifier="com.ninxsoft.mist.helper"
|
||||||
|
files=(
|
||||||
|
"/Applications/Mist.app"
|
||||||
|
"/Library/LaunchDaemons/$identifier.plist"
|
||||||
|
"/Library/PrivilegedHelperTools/$identifier"
|
||||||
|
)
|
||||||
|
did_something=""
|
||||||
|
|
||||||
|
# check for escalated privileges
|
||||||
|
if [[ ! "$EUID" == 0 ]] ; then
|
||||||
|
echo "This script needs to be run as root! Exiting..."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# unload privileged helper tool
|
||||||
|
if launchctl print "system/$identifier" &> /dev/null ; then
|
||||||
|
echo "Unloading Privileged Helper Tool..."
|
||||||
|
launchctl bootout "system/$identifier"
|
||||||
|
did_something="Yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove files
|
||||||
|
for file in "${files[@]}" ; do
|
||||||
|
|
||||||
|
if [[ -e "$file" ]] ; then
|
||||||
|
echo "Removing '$file'..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$file" ]] ; then
|
||||||
|
rm "$file"
|
||||||
|
did_something="Yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "$file" ]] ; then
|
||||||
|
rm -r "$file"
|
||||||
|
did_something="Yes"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$did_something" ]] ; then
|
||||||
|
echo "Done!"
|
||||||
|
else
|
||||||
|
echo "Nothing to do!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue