Skip to content

Commit

Permalink
Source detectIncompleteState.sh in load.sh for barrel export.
Browse files Browse the repository at this point in the history
Remove leftover residue from the merge conflict resolution.
Assign `keyName` to `importedKeyName` to prevent an empty key name in the treehouses config.
  • Loading branch information
hiroTochigi committed Oct 3, 2024
1 parent d438d2d commit 2e45f55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/aws/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source $manageConfigPath/src/aws/dependencies/sshtunnelFunction.sh
source $manageConfigPath/src/aws/dependencies/reverseShell.sh
source $manageConfigPath/src/aws/dependencies/updateOrAppend.sh
source $manageConfigPath/src/aws/dependencies/getProcessNumber.sh
source $manageConfigPath/src/aws/dependencies/detectIncompleteState.sh

source $manageConfigPath/src/utils/dependencies/config.sh
source $manageConfigPath/src/utils/dependencies/array.sh
Expand Down
35 changes: 16 additions & 19 deletions src/aws/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function up {
echo "Success to add ssh key: $importedKeyName"
else
echo "The key pair $keyname already exists. Please use another key name."
importedKeyName=$keyname
fi

if ! checkSecurityGroup; then
Expand Down Expand Up @@ -197,25 +198,21 @@ function up {
exit 1
fi
echo "Success to add ssh key: $importedKeyName"
else
echo "The key pair $keyname already exists. Please use another key name."
importedKeyName=$keyname
fi

case "$instanceState" in
"running")
echo "EC2 instance is already running."
;;
"stopped")
echo "Starting stopped EC2 instance..."
start $instanceName
;;
"terminated")
createAndTagInstance
;;
*)
echo "EC2 instance is in state: $instanceState."
;;
esac
fi
case "$instanceState" in
"running")
echo "EC2 instance is already running."
;;
"stopped")
echo "Starting stopped EC2 instance..."
start $instanceName
;;
"terminated")
createAndTagInstance
;;
*)
echo "EC2 instance is in state: $instanceState."
;;
esac
}

0 comments on commit 2e45f55

Please sign in to comment.