Created
May 1, 2019 05:03
-
-
Save florido/305f8468c5af51fac7a225d05cf4de10 to your computer and use it in GitHub Desktop.
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 | |
/usr/bin/osascript <<EOT | |
set theResponse to display dialog "What's your code?" default answer "" with icon stop buttons {"Cancel", "Continue"} default button "Continue" with hidden answer | |
display dialog "My Secret Code is " & (text returned of theResponse) & "." | |
EOT | |
OR | |
#!/bin/bash | |
HWNAME=$(osascript <<EOD | |
tell application "System Events" | |
text returned of (display dialog "Please enter your desired hostname: (Use dashes for spaces)" default answer "") | |
end tell | |
EOD) | |
scutil --set ComputerName "$HWNAME" | |
scutil --set LocalHostName "$HWNAME" | |
dscacheutil -flushcache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment