Skip to content

Commit 2e45f55

Browse files
committed
Source detectIncompleteState.sh in load.sh for barrel export.
Remove leftover residue from the merge conflict resolution. Assign `keyName` to `importedKeyName` to prevent an empty key name in the treehouses config.
1 parent d438d2d commit 2e45f55

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

src/aws/load.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ source $manageConfigPath/src/aws/dependencies/sshtunnelFunction.sh
1212
source $manageConfigPath/src/aws/dependencies/reverseShell.sh
1313
source $manageConfigPath/src/aws/dependencies/updateOrAppend.sh
1414
source $manageConfigPath/src/aws/dependencies/getProcessNumber.sh
15+
source $manageConfigPath/src/aws/dependencies/detectIncompleteState.sh
1516

1617
source $manageConfigPath/src/utils/dependencies/config.sh
1718
source $manageConfigPath/src/utils/dependencies/array.sh

src/aws/up.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ function up {
158158
echo "Success to add ssh key: $importedKeyName"
159159
else
160160
echo "The key pair $keyname already exists. Please use another key name."
161+
importedKeyName=$keyname
161162
fi
162163

163164
if ! checkSecurityGroup; then
@@ -197,25 +198,21 @@ function up {
197198
exit 1
198199
fi
199200
echo "Success to add ssh key: $importedKeyName"
200-
else
201-
echo "The key pair $keyname already exists. Please use another key name."
202-
importedKeyName=$keyname
203201
fi
204202

205-
case "$instanceState" in
206-
"running")
207-
echo "EC2 instance is already running."
208-
;;
209-
"stopped")
210-
echo "Starting stopped EC2 instance..."
211-
start $instanceName
212-
;;
213-
"terminated")
214-
createAndTagInstance
215-
;;
216-
*)
217-
echo "EC2 instance is in state: $instanceState."
218-
;;
219-
esac
220-
fi
203+
case "$instanceState" in
204+
"running")
205+
echo "EC2 instance is already running."
206+
;;
207+
"stopped")
208+
echo "Starting stopped EC2 instance..."
209+
start $instanceName
210+
;;
211+
"terminated")
212+
createAndTagInstance
213+
;;
214+
*)
215+
echo "EC2 instance is in state: $instanceState."
216+
;;
217+
esac
221218
}

0 commit comments

Comments
 (0)