Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Assets/Uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
current_user=$(ls -l /dev/console | awk '{print $3}')
console_user_uid=$(/usr/bin/id -u "$current_user")
#!/bin/sh
# Script requires root so check for root access
if [ $(id -u) -ne 0 ]; then
echo "Please run this script as root or using sudo"
exit 1
fi
# Use Apple Recommended Method to detect the user signed in to the desktop
current_user=$(echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }')
console_user_uid=$(echo "show State:/Users/ConsoleUser" | scutil | awk '/kCGSSessionUserIDKey/ {print $NF; exit}' )
# Kill the process
echo "Killing the process..."
pkill -f SupportCompanion
Expand Down Expand Up @@ -27,4 +34,4 @@ rm -rf "/Library/Application Support/SupportCompanion"
echo "Forgetting the package..."
pkgutil --forget com.almenscorner.supportcompanion > /dev/null 2>&1
pkgutil --forget com.almenscorner.supportcompanion.LaunchAgent > /dev/null 2>&1
pkgutil --forget com.almenscorner.supportcompanion.suite > /dev/null 2>&1
pkgutil --forget com.almenscorner.supportcompanion.suite > /dev/null 2>&1