Guys,
I am looking for something similar. I already have a rather basic script that returns, ComputerName, LocalHostName, and HostName.
Now, I want to add to the script, with interactive function.
Enter the "new" ComputerName (which will then also be used for LocalHostName and HostName), gets set by scutil --set, then return / list the new names for all three.
thanks,
jk
#!/bin/bash
function GREEN {
tput setaf 2
}
function ENDColor {
tput op
}
echo ComputerName
GREEN
scutil --get ComputerName
ENDColor
echo LocalHostName
GREEN
scutil --get LocalHostName
ENDColor
echo HostName
GREEN
scutil --get HostName
ENDColor
echo
tput setaf 5
echo "Make sure the names all match - if they don't, tell a grown up near you!"
tput op
echo
echo
echo "press Enter to close this window"
read