Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var child_process = require("child_process")
- function getIPs (cb) {
- child_process.exec("ifconfig -a", function (er, o) {
- if (er) return cb(er)
- cb(null, o.match(/inet ([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3})/g).map(function (i) {
- return i.replace(/^inet /, '')
- }))
- })
- }
- getIPs(function (er, ips) {
- console.error([er, ips])
- })
Add Comment
Please, Sign In to add comment