Uninstall ChefDK
29 Feb 2016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Run with sudo. This will completely uninstall ChefDK, continue? (y/n) " | |
read yn | |
if [ "$yn" != "y" ] && [ "$yn" != "Y" ]; then | |
echo "Not doing anything. Exiting." | |
exit 1 | |
fi | |
echo "doing the stuff!" | |
if [ -d /opt/chefdk ]; then | |
rm -rf /opt/chefdk | |
else | |
echo "/opt/chefdk doesn't exist" | |
fi | |
pkgutil --forget com.getchef.pkg.chefdk | |
find /usr/bin -lname '/opt/chefdk/*' -delete | |
if [ -d ~/.chefdk ]; then | |
echo "Moving ~/.chefdk to ~/.chefdk_old" | |
mv ~/.chefdk ~/.chefdk_old | |
fi | |
echo "Done! Now you can reinstall ChefDK: https://docs.chef.io/install_dk.html" |