first commit
This commit is contained in:
16
build/node_modules/macaddress/lib/unix.js
generated
vendored
Normal file
16
build/node_modules/macaddress/lib/unix.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
module.exports = function (iface, callback) {
|
||||
exec("ifconfig " + iface, function (err, out) {
|
||||
if (err) {
|
||||
callback(err, null);
|
||||
return;
|
||||
}
|
||||
var match = /[a-f0-9]{2}(:[a-f0-9]{2}){5}/.exec(out.toLowerCase());
|
||||
if (!match) {
|
||||
callback("did not find a mac address", null);
|
||||
return;
|
||||
}
|
||||
callback(null, match[0].toLowerCase());
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user