Last active
May 10, 2019 18:04
-
-
Save o0-o/1d0dbce78dfc360f08904e5e3474d20e to your computer and use it in GitHub Desktop.
[Serial Number] Retrieves the serial number of the host (if one exists) #Shell
This file contains hidden or 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
# serial.sh | |
( # edgeos | |
show version | | |
grep "HW S/N:" || | |
# linux/bsd x86 | |
dmidecode --string system-serial-number || | |
# macos | |
ioreg -l | | |
grep IOPlatformSerialNumber | | |
tr -d '"' || | |
# linux/arm | |
grep --ignore-case serial /proc/cpuinfo | |
) 2>/dev/null | | |
awk '{print $NF}' || | |
exit 1 #failure | |
exit 0 #success | |
# http://kb.mit.edu/confluence/pages/viewpage.action?pageId=152578725 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment