From ee2193fcbe6ee9eca1e115bba9d83f716b98c42b Mon Sep 17 00:00:00 2001 From: Jon Higgs Date: Thu, 31 Jan 2013 16:19:58 +0100 Subject: [PATCH] make sure that that the region doesn't get overwritten. --- ec2-automate-backup/ec2-automate-backup.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ec2-automate-backup/ec2-automate-backup.sh b/ec2-automate-backup/ec2-automate-backup.sh index 3ef1e57..056e33e 100755 --- a/ec2-automate-backup/ec2-automate-backup.sh +++ b/ec2-automate-backup/ec2-automate-backup.sh @@ -150,11 +150,6 @@ app_name=`basename $0` #sets defaults selection_method="volumeid" -if [ -z $EC2_REGION ]; - then region="us-east-1" -else - region="$EC2_REGION" -fi #date_binary allows a user to set the "date" binary that is installed on their system and, therefore, the options that will be given to the date binary to perform date calculations date_binary="" @@ -190,6 +185,14 @@ if [[ -n $cron_primer ]] fi fi +if [ -z $region ]; then + if [ -z $EC2_REGION ]; then + region="us-east-1" + else + region="$EC2_REGION" + fi +fi + #calls prerequisitecheck function to ensure that all executables required for script execution are available prerequisite_check