Skip to content
Open
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
11 changes: 8 additions & 3 deletions Examples/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,25 @@ if [ "$(whoami)" != "root" ]; then
fi

if launchctl list | grep -q "$bundleID.finished" ; then
echo "unloading launch daemon"
echo "unloading launch daemon for $bundleID.finished"
launchctl unload /Library/LaunchDaemons/"$bundleID".finished.plist
fi

if launchctl list | grep -q "$bundleID.loginwindow" ; then
echo "unloading launch agent for $bundleID.loginwindow"
launchctl unload /Library/LaunchAgents/"$bundleID".loginwindow.plist
fi

if launchctl list | grep -q "$bundleID" ; then
echo "unloading launch daemon"
echo "unloading launch daemon for $bundleID"
launchctl unload /Library/LaunchDaemons/"$bundleID".plist
fi

echo "removing files"
rm -rfv "$appPath"
rm -v /Library/LaunchDaemons/"$bundleID".plist
rm -v /Library/LaunchAgents/"$bundleID".loginwindow.plist
rm -v /Library/LaunchAgents/"$bundleID".finished.plist
rm -v /Library/LaunchDaemons/"$bundleID".finished.plist

echo "forgetting $bundleID pkg receipt"
pkgutil --forget "$bundleID"
Expand Down