Files
Alte_Skripte/de.ing.uninstall.Identity_Agent.sh
2026-02-16 15:05:15 +01:00

31 lines
1.1 KiB
Bash

#!/bin/bash
##########################################################################
# Shellscript : Clear uninstall Identety Agent
# Autor : Andreas Vogel, macenterprise gmbh, 2019
# Description : Das Script löscht die App, die .plists sowie die im Schlüsselbund gespeicherten Passwörter.
##########################################################################
# Gets username
user=$(stat -f '%u %Su' /dev/console | cut -d ' ' -f 2)
# Close Identity Agent if run
if ( pgrep "Identity Agent" > /dev/null ); then
echo "Killing Identity Agent"
killall "Identity Agent"
else
echo "Identity Agent is not running"
fi
# Remove plist and files for Identity Agent
rm -rf /Applications/Identity\ Agent.app
rm -rf "/Users/$user/Library/Application Support/Identity Agent"
rm -rf "/Users/$user/Library/Preferences/com.checkpoint.IdentityAgent.plist"
rm -rf /private/var/folders/7c/fthrmcsn5sx6bkc__k65hv840000gr/C/com.checkpoint.IdentityAgent
# Remove Keychain Items
security delete-generic-password -l "NAC" /Users/$user/Library/Keychains/login.keychain
# restart the Computer now
sudo shutdown -r now