Skip to content

Instantly share code, notes, and snippets.

@samof76
Last active September 1, 2017 05:35
Show Gist options
  • Save samof76/9e7df98ed2e713477df0c42bd0fe41e8 to your computer and use it in GitHub Desktop.
Save samof76/9e7df98ed2e713477df0c42bd0fe41e8 to your computer and use it in GitHub Desktop.
This script will prepare instance before creating an AMI
#!/bin/bash
/etc/init.d/monit stop
/etc/init.d/opsworks-agent stop
rm -rf /etc/aws/opsworks/ /opt/aws/opsworks/ /var/log/aws/opsworks/ /var/lib/aws/opsworks/ /etc/monit.d/opsworks-agent.monitrc /etc/monit/conf.d/opsworks-agent.monitrc /var/lib/cloud/ /etc/chef
rpm -e opsworks-agent-ruby
rpm -e chef
/etc/init.d/nginx stop
# mv /data /data_copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment