Update ping.js

This commit is contained in:
William Harrison authored and GitHub committed 2023-05-01 12:39:57 +08:00
1 parent 5032d2cd42
commit 6680eaf7ae
1 file changed
+2 -4
+2 -4
View File
@@ -11,8 +11,7 @@ fs.readdirSync("domains").forEach(async (file) => {
if (recordType === "A" || recordType === "AAAA") {
for (const val of recordValue) {
try {
const ping = await exec(`ping -c 1 ${recordValue}`);
console.log(ping);
await exec(`ping -c 1 ${recordValue}`);
console.log(`PASS ${domain} ${recordType} ${val}`);
fs.appendFileSync("ping_results.txt", `PASS ${domain} ${recordType} ${val}\n`);
} catch {
@@ -22,8 +21,7 @@ fs.readdirSync("domains").forEach(async (file) => {
}
} else if (recordType === "CNAME") {
try {
const ping = await exec(`ping -c 1 ${recordValue}`);
console.log(ping);
await exec(`ping -c 1 ${recordValue}`);
console.log(`PASS ${domain} ${recordType} ${recordValue}`);
fs.appendFileSync("ping_results.txt", `PASS ${domain} ${recordType} ${recordValue}\n`);
} catch {