Created
October 3, 2016 18:28
-
-
Save ihashacks/484c504c58f4464bae7996d305fcd70f to your computer and use it in GitHub Desktop.
quick and dirty Mac sysinfo script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MAC_TYPE=$(curl -s "http://support-sp.apple.com/sp/product?cc=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ' | cut -c 9-)" | sed 's|.*<configCode>\(.*\)</configCode>.*|\1|') | |
MAC_PROCESSOR=$(sysctl -n machdep.cpu.brand_string) | |
MAC_MEMORY="$(( $(sysctl -n hw.memsize) / 1024 ** 3 )) GB" | |
MAC_SERIAL=$(system_profiler SPHardwareDataType | awk ' /Serial/ { print $4 } ') | |
echo "System: ${MAC_TYPE}" | |
echo "CPU: ${MAC_PROCESSOR}" | |
echo "Memory: ${MAC_MEMORY}" | |
echo "Serial: ${MAC_SERIAL}" |
brandonpierce
commented
Oct 3, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment