I have a group of 400 Macs I take care of and I am trying to automate the naming and setting up the static ip based on the SN of the system with a first run script. Here is a small sample of the script but it is giving me an end of file error when I try and run it. Any ideas?
#!/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