Skip to content

Commit

Permalink
better error handling / return code setting for ssh-ssm
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Steinberg committed May 22, 2023
1 parent 45d1c0b commit 1794c85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bash/aws_functions
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ function ssh-ssm() {
hostname=$1
shift
instance_id=$(instance_id_from_name ${hostname})
if [ "$instance_id" != "" ] ; then
ssh $instance_id $@
if [ "$instance_id" == "" ] ; then
echo "No instance id found for hostname ${hostname}"
return 2
fi
ssh $instance_id $@
}

function retag-ecr-image() {
Expand Down

0 comments on commit 1794c85

Please sign in to comment.