From: Charlie Fish Date: Fri, 11 Jun 2021 23:54:05 +0000 (-0600) Subject: Fixing issue in dnsmasq generation script where “/“ would exist on header lines X-Git-Tag: aggregated-20250518~559^2~1^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e23ea01641b04acab08753f565949823b526fe6;p=thirdparty%2Fblocklistproject%2Flists.git Fixing issue in dnsmasq generation script where “/“ would exist on header lines --- diff --git a/scripts/generate-dnsmasq.js b/scripts/generate-dnsmasq.js index f76bf89..2c08431 100644 --- a/scripts/generate-dnsmasq.js +++ b/scripts/generate-dnsmasq.js @@ -6,9 +6,9 @@ const path = require("path"); await Promise.all(files.map(async (file) => { // For each file const fileContents = await fs.readFile(path.join(__dirname, "..", file), "utf8"); // Get file contents as a string const noIPFileContents = fileContents + .replaceAll(/0\.0\.0\.0 (.*?)( .*)?$/gmu, "0.0.0.0 $1/$2") // I need this line to add "/" at the end of each URL .replaceAll(/^0\.0\.0\.0 /gmu, "server=/") // Replace all occurances of "0.0.0.0 " at the beginning of the line with "server=/" .replaceAll(/^# 0\.0\.0\.0 /gmu, "# server=/") // Replace all occurances of "# 0.0.0.0 " at the beginning of the line with "# server=/" - .replaceAll(/^(.*)$/gmu, "$1/") // I need this line to add "/" at the end of each URL .replace(/^# Title: (.*?)$/gmu, "# Title: $1 (NL)"); // Add (NL) to end of title await fs.writeFile(path.join(__dirname, "..", "dnsmasq-version", file.replace(".txt", "-dnsmasq.txt")), noIPFileContents, "utf8"); // Write new file to `alt-version` directory }));