Created
April 11, 2016 12:01
-
-
Save patrickmaciel/82f516cdf56aa8fd2616361bc14b4db4 to your computer and use it in GitHub Desktop.
Git hook SSH another EC2 server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
unset $(git rev-parse --local-env-vars) | |
echo '' | |
echo '[SSH] Connecting in site.iab.hml...' | |
ssh -i /home/ubuntu/.ssh/ANOTHER_SERVER_PEM.pem ubuntu@IP_FROM_ANOTHER_SERVER <<'ENDSSH' | |
echo '[IN] Connected!' | |
echo '[IN] Listing directories...' | |
to | |
ls -liah | |
echo '[IN] Listed!' | |
echo '[IN] Exiting...' | |
exit | |
echo '[OUT] Exited!' | |
echo '' | |
echo 'Bye :)' | |
echo '' | |
ENDSSH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment