Skip to content

Commit

Permalink
tidy up progress output
Browse files Browse the repository at this point in the history
  • Loading branch information
redterror committed Nov 30, 2021
1 parent 25bd349 commit 0db8d17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/aws-docker-console
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ while [ "$dockerId" == 'null' ] || [ -z "$dockerId" ]; do
sleep 1
done

echo "-> Loading console on instance $instanceName / $instanceId / $instanceIp and attaching to task ${taskArn}..."

# with the instance address and docker container, we now have all we need to launch into an
# interactive console using `ssh -t`, which launches a pseudo-tty that lasts until we close the
# session
Expand All @@ -111,19 +109,21 @@ echo "-> Loading console on instance $instanceName / $instanceId / $instanceIp a

# Ensure jq is installed
set +e
echo "-> Ensuring jq is installed on the ECS host..."
$SSH --instance-id=${instanceId} -- -qt sudo ${INSTALL_JQ_REMOTE_CMD}
set -e

echo "-> Loading console and attaching to task..."
$SSH --instance-id=${instanceId} -- -qt docker exec -ti "$dockerId" /bin/bash
sleep 0.5

# after we close the tty we'll stop the task so it doesn't sit around wasting resources

echo -n "-> Stopping task ${taskArn}..."
echo "-> Stopping task ${taskArn}..."

response=$(aws ecs stop-task \
--cluster "$cluster" \
--task "$taskArn" \
--reason 'user-console/stop')

echo -e '\r-> Stopping task... done'
echo "-> Task stopped"

0 comments on commit 0db8d17

Please sign in to comment.