I run a farm of 150 Mac minis. I am trying to create a first run script that will set the host name and static IP based on the SN. I am getting an end of file error when I am trying to run it. Here is a small sample. Any help would be great!
!/bin/sh
serial=/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/awk '/Serial Number (system)/ {print $NF}'
if test "$serial" == "C07M802Z4E825DY3J"
then
scutil --set ComputerName "qa-mac-1"
scutil --set LocalHostName "qa-mac-1"
networksetup -setproxyautodiscovery "Ethernet" on
networksetup -setmanual Ethernet 10.1.1.1 255.255.255.128 10.1.1.129
networksetup -setdnsservers Ethernet 10.2.76.98 10.2.76.97
networksetup -setsearchdomains Ethernet mycompany.com mycompanycorp.com us.mycompany.com
else
if test "$serial" == "C07M803JDLSY3J"
then
scutil --set ComputerName "qa-mac-2"
scutil --set LocalHostName "qa-mac-2"
networksetup -setproxyautodiscovery "Ethernet" on
networksetup -setmanual Ethernet 10.1.1.2 255.255.255.128 10.1.1.129
networksetup -setdnsservers Ethernet 10.2.76.98 10.2.76.97
networksetup -setsearchdomains Ethernet mycompany.com mycompanycorp.com us.mycompany.com
if test "$serial" == "C0737951JDLSY3J"
then
scutil --set ComputerName "qa-mac-3"
scutil --set LocalHostName "qa-mac-3"
networksetup -setproxyautodiscovery "Ethernet" on
networksetup -setmanual Ethernet 10.1.1.2 255.255.255.128 10.1.1.129
networksetup -setdnsservers Ethernet 10.2.76.98 10.2.76.97
networksetup -setsearchdomains Ethernet mycompany.com mycompanycorp.com us.mycompany.com
fi
exit 0