aws / aws-ec2-instance-connect-cli

This is an all-in-one client for EC2 Instance Connect that handles key brokerage and establishing connection to EC2 Instances through an interface near-identical to standard system ssh, sftp, and other utilities.
Apache License 2.0
159 stars 42 forks source link

Forward the exit status from the remote command #9

Closed kimhanse closed 4 years ago

kimhanse commented 4 years ago

Please change the mssh command to forward the exit status of the remote command the same way ssh does.

The man page from ssh describing this:

EXIT STATUS ssh exits with the exit status of the remote command or with 255 if an error occurred.

Example:

kim@splint:~$ mssh ec2-user@i-012345678990 exit 42 ; echo $?
0
kim@splint:~$ 

This should echo 42 instead of 0.

jaseemabid commented 4 years ago

+1 on this. I've scripts that wait until the server is ready and exiting with 0 breaks that kind of workflow. It would be great to get this prioritised.

LeszekBlazewski commented 4 years ago

I see that a fix has been already provided but the repo seems unmaintained. Are there any plans to merge this fix anytime soon ?

Would be awesome thanks !

yellowtailfan commented 4 years ago

Getting the return code from mssh is very important for the code I'm working on, so I was happy when I found a fork with a fix:

https://github.com/mplaza-ptc/aws-ec2-instance-connect-cli/commit/57ab4b5ab64b0cfd916741b5e7e8479b583c154d

which the author has kindly published at PyPI:

https://pypi.org/project/ec2instanceconnectcli-ptc/

LeszekBlazewski commented 4 years ago

Hey man this is a real life saver, thanks for the link !

On Mon, 22 Jun 2020 at 12:03, Matthew Arnison notifications@github.com wrote:

Getting the return code from mssh is very important for the code I'm working on, so I found a fork with a fix:

mplaza-ptc@57ab4b5 https://github.com/mplaza-ptc/aws-ec2-instance-connect-cli/commit/57ab4b5ab64b0cfd916741b5e7e8479b583c154d

which the author has kindly published at PyPI:

https://pypi.org/project/ec2instanceconnectcli-ptc/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aws/aws-ec2-instance-connect-cli/issues/9#issuecomment-647417783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKPEJQACTC6APJZM7TZ6RLRX4UANANCNFSM4JANBENQ .

-- Pozdrawiam,

Leszek Błażewski

https://www.e-korepetycje.net/beard

https://www.linkedin.com/in/leszek-blazewski/

CptTZ commented 4 years ago

Hi @yellowtailfan, thanks for providing this! I'm not aware of that fork, however I would recommend verifying that code before using it.

And to everyone else, sorry for the delays in keeping CLI updated. We are now actively working on releasing a new version with some improvements.

LeszekBlazewski commented 4 years ago

Awesome that the fix has been merged !

I don't want to open new issue for this but are there any plans to release the version with fixes to PyPI in order to install it with pip ?

I guess you are working on an bigger release but is there any ETA when we can expect the new version on PyPI ?

Best regards :)

CptTZ commented 4 years ago

Awesome that the fix has been merged !

I don't want to open new issue for this but are there any plans to release the version with fixes to PyPI in order to install it with pip ?

I guess you are working on an bigger release but is there any ETA when we can expect the new version on PyPI ?

Best regards :)

We are working on the final steps now, I don't have an ETA but it should be quick. I will update here once PyPI is updated.

Thanks for the support!