How to perform a silent uninstall of inSync Client from a Mac device
This article applies to:
- OS: Mac
- Product edition: inSync Client
Overview
inSync administrator may want to remove the inSync agent completely from the user devices without user inputs. Uninstalling inSync Client from a Mac device may be pushed from any deployment tool. However, macOS prompts to retain inSync configuration before removing the agent. The following script removes inSync from the Mac devices and can be pushed from any deployment tool.
Uninstall inSync Client v6.5.0 and later
#!/bin/bash
set +x
user=`ls -l /dev/console | awk '//{print $3}'`
U='/tmp/inSync_client_uninstallation.log'
echo "loggedInUser:" $user >> $U 2>&1
echo "Stopping inSync Client." >> $U
killall inSync
killall inSyncDecommission
echo "Cleaning up inSync Application from the machine" >> $U
launchctl unload /Library/LaunchDaemons/inSyncDecommission.plist
rm -f /Library/LaunchDaemons/inSyncDecommission.plist
sleep 3
launchctl unload /Library/LaunchAgents/inSyncAgent.plist
rm -f /Library/LaunchAgents/inSyncAgent.plist
sleep 3
echo "Cleaning up Keychain entries" >>$U
/Applications/Druva\ inSync.app/Contents/MacOS/inSyncDecommission RemoveKeychainItems
sleep 5
echo "Cleaning up package" >>$U
mv /Applications/Druva\ inSync /Applications/Druva\ inSync_old
sleep 5
echo "Cleaning up local Directories" >>$U
mv /Users/$user/Library/Application\ Support/inSync /Users/$user/Library/Application\ Support/inSync_old
exit
Uninstall inSync Client v6.2.0 and earlier
#!/bin/bash
set +x
user=`ls -l /dev/console | awk '//{print $3}'`
U='/tmp/inSync_client_uninstallation.log'
echo "loggedInUser:" $user >> $U 2>&1
echo "Stopping inSync Client." >> $U
killall inSync
killall inSyncDecommission
echo "Cleaning up inSync Application from the machine" >> $U
launchctl unload /Library/LaunchDaemons/inSyncDecommission.plist
rm -f /Library/LaunchDaemons/inSyncDecommission.plist
sleep 3
launchctl unload /Library/LaunchAgents/inSyncAgent.plist
rm -f /Library/LaunchAgents/inSyncAgent.plist
sleep 3
echo "Cleaning up Keychain entries" >>$U
/Applications/Druva\ inSync/inSync.app/Contents/MacOS/inSyncDecommission RemoveKeychainItems
sleep 5
echo "Cleaning up package" >>$U
mv /Applications/Druva\ inSync /Applications/Druva\ inSync_old
sleep 5
echo "Cleaning up local Directories" >>$U
mv /Users/$user/Library/Application\ Support/inSync /Users/$user/Library/Application\ Support/inSync_old
exit