File tree Expand file tree Collapse file tree 2 files changed +17
-19
lines changed Expand file tree Collapse file tree 2 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ source $manageConfigPath/src/aws/dependencies/sshtunnelFunction.sh
1212source $manageConfigPath /src/aws/dependencies/reverseShell.sh
1313source $manageConfigPath /src/aws/dependencies/updateOrAppend.sh
1414source $manageConfigPath /src/aws/dependencies/getProcessNumber.sh
15+ source $manageConfigPath /src/aws/dependencies/detectIncompleteState.sh
1516
1617source $manageConfigPath /src/utils/dependencies/config.sh
1718source $manageConfigPath /src/utils/dependencies/array.sh
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments