Created
February 18, 2012 01:44
-
-
Save skyisle/1856804 to your computer and use it in GitHub Desktop.
Shell script to connect icloud host through ssh
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
#!/bin/bash | |
if [ ! -n "$1" ] | |
then | |
echo "Usage: `basename $0` hostname" | |
exit $E_BADARGS | |
fi | |
HOSTNAME=$1 | |
DOMAIN=$(echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p') | |
echo "Connecting to :" ${HOSTNAME}.${DOMAIN}"..." | |
ssh ${HOSTNAME}.${DOMAIN} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment