Created
August 20, 2014 14:44
-
-
Save Phelms215/c6eb383cf8b1f7128e59 to your computer and use it in GitHub Desktop.
Chef Dereg
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/bash | |
# | |
### BEGIN INIT INFO | |
# Provides: chef-dereg | |
# Required-Start: $local_fs $network | |
# Required-Stop: | |
# Default-Start: 0 | |
# Default-Stop: | |
# Short-Description: chef-dereg | |
# Description: Chef bootstrap de-register script | |
### END INIT INFO | |
echo "We stopped" >> /tmp/proof.log | |
node_name=`cat /etc/chef/node_name` | |
knife node delete -y -c /etc/chef/client.rb $node_name | |
knife client delete -y -c /etc/chef/client.rb $node_name | |
rm -f /etc/chef/client.rb | |
rm -f /etc/chef/client.pem | |
rm -f /etc/chef/validation.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment