This commit is contained in:
10
index.js
10
index.js
@@ -6,17 +6,7 @@ const express = require('express')
|
||||
const app = express()
|
||||
|
||||
app.get('/ip', async (req, res) => {
|
||||
|
||||
let output = execSync(command, { encoding: "utf8" });
|
||||
// let output = `2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
|
||||
// inet6 240e:362:2245:9b00::68c/128 scope global dynamic noprefixroute
|
||||
// valid_lft 24426sec preferred_lft 24426sec
|
||||
// inet6 240e:362:2245:9b00:2e0:4cff:fe09:1f7f/64 scope global dynamic mngtmpaddr noprefixroute
|
||||
// valid_lft 222142sec preferred_lft 135742sec
|
||||
// inet6 240e:362:223c:2800:2e0:4cff:fe09:1f7f/64 scope global dynamic mngtmpaddr noprefixroute
|
||||
// valid_lft 221829sec preferred_lft 135429sec
|
||||
// inet6 fe80::2e0:4cff:fe09:1f7f/64 scope link
|
||||
// valid_lft forever preferred_lft forever`
|
||||
res.json(await ip.parseNetworkInfo(output))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user