Last active
September 17, 2015 22:16
-
-
Save cmittendorf/1dc152d95763f31a1ca0 to your computer and use it in GitHub Desktop.
An AppleScript to ssh with Terminal.app into the the currently selected server instance in the EC2 Management Console in Safari.app.
This file contains 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
set aws to missing value | |
tell application "Safari" | |
tell current tab | |
set aws to do JavaScript "document.getElementsByClassName(\"AOB\")[0].textContent.match(/DNS: (.*\\.amazonaws\\.com)/)[1]" | |
end tell | |
end tell | |
if aws is not missing value then | |
tell application "Terminal" | |
activate | |
do script "ssh admin@" & aws | |
end tell | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment