Skip to content

Instantly share code, notes, and snippets.

@jmahlman
Last active April 27, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmahlman/f4b34c0e3447387c12676e9bfe7bdeca to your computer and use it in GitHub Desktop.
Save jmahlman/f4b34c0e3447387c12676e9bfe7bdeca to your computer and use it in GitHub Desktop.
#!/bin/sh
#
#
# I wrote this simple script because we wanted to rename our Parallels VMs to the local Mac hostname
# We set the VM to automatically log into an admin account and run a powershell script to get the name
# from this file and rename the machine. It then enables autologin for the student account and reboots
#
#
if [ ! -d /Users/Shared ]; then
mkdir /Users/Shared
fi
localName='scutil --get LocalHostName'
$localName | head -c 12 > /Users/Shared/hostname
chmod 777 /Users/Shared/hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment