Last active
December 11, 2015 04:48
-
-
Save rickychilcott/4547214 to your computer and use it in GitHub Desktop.
Login to a Mac via ARD
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
| username=YYYYYYYY | |
| password=XXXXXXXX | |
| #Sanity checks | |
| if [ $username = YYYYYYYY ]; then | |
| echo "You need to set the username" | |
| exit 1 | |
| fi | |
| if [ $password = XXXXXXXX ]; then | |
| echo "You need to set the password" | |
| exit 2 | |
| fi | |
| #Close the Bluetooth setup assistant, if there is one | |
| osascript <<EOT | |
| tell application "System Events" | |
| keystroke "w" using {command down} | |
| end tell | |
| EOT | |
| #Wait a little bit for everything to work | |
| sleep 5 | |
| #Type in the username, password, and press return | |
| osascript <<EOT | |
| tell application "System Events" to keystroke "$username" | |
| tell application "System Events" to delay 2 | |
| tell application "System Events" to keystroke tab | |
| tell application "System Events" to delay 2 | |
| tell application "System Events" to keystroke "$password" | |
| tell application "System Events" to delay 2 | |
| tell application "System Events" to keystroke return | |
| EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment