Skip to main content


 

 

How can we help you?

 

 
Druva Documentation

How to perform a silent uninstall of inSync Client from a Mac device

Heads up!

We've transitioned to a new documentation portal to serve you better. Access the latest content by clicking here.

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.

Prerequisite

How to save shell script on a Mac with VI editor

Open Terminal

On your Mac, do one of the following:

  • Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.

  • In the Finder ,open the /Applications/Utilities folder, then double-click Terminal.

$ vi uninstall.sh <Copy and paste the uninstall script> :wq!

The uninstall script will be saved with the name 'uninstall.sh'

  • How to run the shell script

$ chmod 755 uninstall.sh $ sudo bash uninstall.sh

Uninstall inSync Client v6.5.0 and later

#!/bin/bash

# This script is the uninstall script for Druva InSync

###################### Start of Script ####################

set +x
user=`ls -l /dev/console | awk '//{print $3}'`
echo "loggedInUser:" $user 

echo "  Stopping inSync Client." 

killall inSync
killall inSyncDecommission
killall inSyncClient

echo "  Removing System Files" 

if [ -e /Library/Application\ Support/inSync ]; then
echo "System Application Support found and removed"
rm -rf /Library/Application\ Support/inSync
else
echo "System Application Support not found"
fi

if [ -e /Library/LaunchDaemons/inSyncDecommission.plist ]; then
echo "System Launch Daemon found and removed"
/bin/launchctl unload /Library/LaunchDaemons/inSyncDecommission.plist
rm -f /Library/LaunchDaemons/inSyncDecommission.plist
else
echo "System LaunchDaemon not found"
fi

sleep 3

if [ -e /Library/LaunchAgents/inSyncAgent.plist ]; then
echo "System Launch Agent found and removed"
/bin/launchctl unload /Library/LaunchAgents/inSyncAgent.plist
rm -f /Library/LaunchAgents/inSyncAgent.plist
else
echo "System Launch Agent not found"
fi

sleep 5

echo "  Removing InSync App"

if [ -e /Applications/Druva\ inSync.app ]; then
echo "InSync App found and removed"
rm -rf /Applications/Druva\ inSync.app
else
echo "InSync App not found"
fi

echo "Removing Keychain entries" 

/Applications/Druva\ inSync/inSync.app/Contents/MacOS/inSyncDecommission RemoveKeychainItems


if [ -e /Applications/Druva\ inSync ]; then
echo "Druva Folder App found and removed"
rm -rf "/Applications/Druva inSync"
else
echo "Druva Folder App not found"
fi

sleep 5

echo "  Removing User Directories" 

if [ -e /Users/$user/Library/Application\ Support/inSync ]; then
echo "User Application Support found and removed"
rm -rf /Users/$user/Library/Application\ Support/inSync
else
echo "User Application Support not found"
fi

if [ -e /Users/$user/Library/Preferences/com.trolltech.plist ]; then
echo "User Preferences found and removed"
rm -rf /Users/$user/Library/Preferences/com.trolltech.plist
else
echo "User Preferences not found"
fi

if [ -e /Users/$user/Library/Preferences/com.trolltech.plist.lockfile ]; then
echo "User Preferences trolltech found and removed"
rm -rf /Users/$user/Library/Preferences/com.trolltech.plist.lockfile
else
echo "User Preferences trolltech not found"
fi

if [ -e /Users/$user/Library/LaunchAgents/com.druva.inSyncUpdate.plist ]; then
echo "User Preferences inSyncUpdate found and removed"
rm -rf /Users/$user/Library/LaunchAgents/com.druva.inSyncUpdate.plist
else
echo "User Preferences inSyncUpdate not found"
fi

if [ -e /Users/$user/Library/LaunchAgents/com.druva.inSyncUpdateAgent.plist ]; then
echo "User Launch Agent found and removed"
rm -rf /Users/$user/Library/LaunchAgents/com.druva.inSyncUpdateAgent.plist
else
echo "User Launch Agent not found"
fi

if [ -e /Users/$user/Library/Containers/com.druva.insync.FinderPlugin/** ]; then
echo "User Containers found and removed"
rm -rf /Users/$user/Library/Containers/com.druva.insync.FinderPlugin/**
else
echo "User Containers not found"
fi

if [ -e /Users/$user/Library/Group\ Containers/com.druva.insync.sharedDefaults/** ]; then
echo "User Group Containers found and removed"
rm -rf /Users/$user/Library/Group\ Containers/com.druva.insync.sharedDefaults/**
else
echo "User Group Containers not found"
fi

echo "  Removing pkgutil for Druva"

pkgutil --forget com.druva.inSync.pkg

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