Skip to content

Instantly share code, notes, and snippets.

@bkeating
Created November 17, 2020 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkeating/3f584315a776ec6aff8cd580e3c7507a to your computer and use it in GitHub Desktop.
Save bkeating/3f584315a776ec6aff8cd580e3c7507a to your computer and use it in GitHub Desktop.
const getserial = () => {
const fs = require('fs');
const content = fs.readFileSync('/proc/cpuinfo', 'utf8');
const cont_array = content.split("\n");
const serial_line = cont_array[cont_array.length-2];
const serial = serial_line.split(":");
return serial[1].slice(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment