← Back to team overview

yellow team mailing list archive

[Merge] lp:~bac/lp-tarmac-configs/add-scripts into lp:~yellow/lp-tarmac-configs/tarmac-puppet

 

Brad Crittenden has proposed merging lp:~bac/lp-tarmac-configs/add-scripts into lp:~yellow/lp-tarmac-configs/tarmac-puppet.

Requested reviews:
  Yellow Squad (yellow): code

For more details, see:
https://code.launchpad.net/~bac/lp-tarmac-configs/add-scripts/+merge/113401

Add startup and shutdown scripts.
-- 
https://code.launchpad.net/~bac/lp-tarmac-configs/add-scripts/+merge/113401
Your team Yellow Squad is requested to review the proposed merge of lp:~bac/lp-tarmac-configs/add-scripts into lp:~yellow/lp-tarmac-configs/tarmac-puppet.
=== added file 'shutmedown'
--- shutmedown	1970-01-01 00:00:00 +0000
+++ shutmedown	2012-07-04 13:39:22 +0000
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Set up the environment for using Canonistack.  Must be done before
+# using any euca-* commands. 
+source $HOME/.canonistack/novarc
+
+# Ensure there is exactly one instance running.
+lines=`euca-describe-instances |grep -c INSTANCE`
+if [[ $lines == 0 ]]; then
+  echo "Zero instances found.  Nothing to do."
+  exit
+elif [[ $lines > 1 ]]; then
+  echo "$lines instances found.  Exiting."
+  exit
+fi
+
+instance_id=`euca-describe-instances |awk '$1 == "INSTANCE" {print $2}'`
+euca-terminate-instances $instance_id
+

=== added file 'startmeup'
--- startmeup	1970-01-01 00:00:00 +0000
+++ startmeup	2012-07-04 13:39:22 +0000
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Set up the environment for using Canonistack.  Must be done before
+# using any euca-* commands. 
+source $HOME/.canonistack/novarc
+
+fab create


Follow ups