Before I allow a Faculty or staff member to reimage their Mac using our DeployStudio Server I like to have their computer’s vital info entered into the DS computer listing. I wrote the following shell script to collect the relevant info from an end users client machine. I made it an executable (double-clickable) .command file to make it easy. Some commands are commented out as they were redundant. Remove them or use them as you need. Here’s the script:
#!/bin/bash # comment on/off items as needed echo "Please Copy & Paste the following 5 lines and email to username@somewhereland.edu" echo "" echo "----------start copy here----------" #get MAC address echo `/sbin/ifconfig en0 | awk '/ether/ { gsub(":", ""); print $2 }'` #networksetup -getcomputername #networksetup -getcomputername systemsetup -getcomputername systemsetup -getlocalsubnetname #networksetup -gethostname #networksetup -getbonjourname #scutil –get ComputerName defaults read /Library/Preferences/com.apple.RemoteDesktop "Text1" defaults read /Library/Preferences/com.apple.RemoteDesktop "Text2" #defaults read /Library/Preferences/com.apple.RemoteDesktop "Text3" #defaults read /Library/Preferences/com.apple.RemoteDesktop "Text4" echo `ioreg -l | grep IOPlatformSerialNumber|awk '{print $4}' | cut -d \" -f 2` #system_profiler SPHardwareDataType | grep "Serial Number" #networksetup -getmacaddress en0 sysctl machdep.cpu.brand_string sysctl hw.machine sysctl hw.model echo "----------end copy here----------"echo "" echo "" echo "Thanks!" echo "" exit 0