Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install 6.4.180 KACE Agent and adds kace1000.yourserver.name and runs runkbot
#!/bin/sh
#
# Kace Remover for 5.1 and 5.3 from http://derflounder.wordpress.com
# Removes the 5.1 KBox agent
# Modified on 02/03/2016
# Gilbert Palau
#
sudo /Library/StartupItems/KBOXAgent/KBOXAgent stop
sudo /Library/KBOXAgent/Home/bin/kagentctl stop 2>&1
sudo /Library/KBOXAgent/Home/bin/SMMPctl stop 2>&1
sudo rm -rf /Library/KBOXAgent
sudo rm -rf /Library/StartupItems/KBOXAgent
sudo rm -rf /Library/Receipts/KBOX\ Agent.pkg
sudo rm -rf /var/kace
sudo rm -rf /var/db/receipts/com.kace.kboxagent.bom
sudo rm -rf /var/db/receipts/com.kace.kboxagent.plist
sudo rm -rf /Library/LaunchDaemons/kace.smmpagent.bootup.plist
# Removes the 5.3 or 5.5 KBox agent
sudo /Library/StartupItems/AMPAgentBootup/AMPAgentBootup stop
sudo /Library/Application\ Support/Dell/KACE/bin/AMPctl stop 2>&1
sudo /Library/Application\ Support/Dell/KACE/bin/kagentctl stop 2>&1
sudo rm -rf /Library/Application\ Support/Dell
sudo rm -rf /Library/StartupItems/AMPAgentBootup
sudo rm -rf /Library/Receipts/AMPAgent.pkg
sudo rm -rf /var/db/receipts/com.kace.ampagent.bom
sudo rm -rf /var/db/receipts/com.kace.ampagent.plist
sudo rm -rf /Library/LaunchAgents/com.kace.AdminAlert.plist
sudo rm -rf /Library/LaunchDaemons/com.kace.ampagent.plist
# Removes KACE Agent 6.x and above
sudo /Library/Application\ Support/Dell/KACE/bin/AMPTools uninstall
# Install 6.4.180 KBox agent and adds kace1000.yourserver.name and runkbot
mkdir -p "/Library/Application Support/Dell/KACE/data"
sleep 15
sh -c 'KACE_SERVER=kace01.utg.uvn.net installer -pkg AMPAgent.pkg -target /'
<<'KBOT'
tell application "Terminal.app"
activate
delay 0.5
do shell script sudo("/Library/Application Support/Dell/KACE/bin/runkbot 1 0")
delay 1
do shell script sudo("/Library/Application Support/Dell/KACE/bin/runkbot 2 0")
end tell
KBOT
@WilliamMyers1

This comment has been minimized.

WilliamMyers1 commented Dec 28, 2017

Hi Gilbert, Have you had any success pairing this script with the 7.2+ agent? The 7.2 agent fails whenever I package a Post-Installation script with it, regardless of the contents and permissions of said script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment