Created
December 4, 2014 01:42
-
-
Save tjluoma/2b1f567dab610f8afbbf to your computer and use it in GitHub Desktop.
If you use Back To My Mac on your Mac, then you are assigned a unique domain name such as "987654321.members.btmm.icloud.com." That domain is only usable on other Macs which are connected to the same iCloud account. In order to find your BTMM domain, you can use the following commands:
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
| # On the command line (note the single \ before the $NF) | |
| echo show Setup:/Network/BackToMyMac | scutil | awk -F' ' "/$UID/{print \$NF}" | |
| alias btmm='echo show Setup:/Network/BackToMyMac | scutil | awk -F" " "/$UID/{print \$NF}"' | |
| function btmm { echo show Setup:/Network/BackToMyMac | scutil | awk -F" " "/$UID/{print \$NF}" } | |
| BTMM=$(echo show Setup:/Network/BackToMyMac | scutil | awk -F' ' "/$UID/{print \$NF}") | |
| # However, if you want to assign it to a variable using FOO=`bar` syntax, then you must use two backslashes: | |
| BTMM=`echo show Setup:/Network/BackToMyMac | scutil | awk -F' ' "/$UID/{print \\$NF}"` |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Previously I had been using this to get my Back To My Mac domain:
however, that does not work if there is more than one user with an iCloud/BackToMyMac account on the same Mac.
(I did not come up with that original command, but unfortunately I cannot find the original source for it anymore.)