5 echo "Clean for AMD copyimage. This script will destroy ssh keys and"
6 echo "logs, touch /firstboot, and generally make a base AMI image that"
7 echo "has not been messed with a whole lot ready for an aws ec2 create-image"
11 echo ' aws ec2 create-image \\'
12 echo ' --name YourAMINameHere \\'
13 echo ' --description "Your AMI Description Here" \\'
14 echo ' --instance-id i-ThisInstanceId \\'
17 if ( "$argv" != "doit" ) then
18 echo "Execute script with 'doit' to really do it"
22 echo "Starting cleanup"
24 rm -f ~root/.ssh/{authorized_keys,known_hosts} ~root/.history
25 rm -f /home/ec2-user/.ssh/{authorized_keys,known_hosts}
26 rm -f /home/ec2-user/.history
30 find /var/log -type f -delete
31 touch /var/log/{auth.log,cron,daemon,maillog,messages,security,userlog}
32 touch /var/log/{wtmp,wtmpx}
34 echo "Cleanup complete"