Created
May 6, 2016 16:22
-
-
Save CodeShane/5b8b7b21d007b36a800c28dbbb7b2d19 to your computer and use it in GitHub Desktop.
View or Change Local System Names on Mac OS X - OSX
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/sh | |
# | |
# View or Change Local System Names | |
# | |
# to view: ./name.sh | |
# to change: ./name.sh newname | |
# passwordless: sudo ./name.sh | |
# | |
if [ -z ${1+x} ] | |
# $1 is unset | |
then | |
echo HostName \(Terminal Prompt\) - generally "HostName: not set" | |
scutil --get HostName | |
echo LocalHostName \(Network\) | |
scutil --get LocalHostName | |
echo ComputerName \(Bonjour\) - generally the same. | |
scutil --get ComputerName | |
else | |
# Terminal Prompt | |
scutil --set HostName $1 | |
# Network | |
scutil --set LocalHostName $1 | |
# Bonjour | |
scutil --set ComputerName $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment