From 1999a6e534fe7aa19e7fbe40b6f4c0b48612e47d Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Mon, 10 Aug 2009 22:12:01 +0200 Subject: run_once_per_ami() and run_once_per_instance() are equivalent, so nuke run_once_per_instance(). There are three cases: You want to run the script every time. In that case, simply do not wrap it. You want to rerun the script every time the AMI has been rebundled. Wrap it in run_once_per_ami. You want to run the script only once, ever. Wrap it in run_once_ever. If I'm missing a case, please tell me. --- ec2-init | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ec2-init b/ec2-init index b2995b79..ab7712e3 100755 --- a/ec2-init +++ b/ec2-init @@ -34,12 +34,6 @@ run_once() { return 1 } -run_once_per_instance() { - action_id=$1 - instance=`ec2-get-info --instance-id | cut -f2 -d\ ` - run_once $instance $action_id -} - run_once_per_ami() { action_id=$1 ami=`ec2-get-info --ami-id | cut -f2 -d\ ` @@ -116,7 +110,7 @@ case "$1" in log_end_msg 1 fi - if run_once_per_instance user-data + if run_once_per_ami user-data then log_daemon_msg "Running EC2 user data" if ec2-run-user-data 2>&1 | logger -t "user-data" -- cgit v1.2.3