mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
added the ability to download both blocklist and allowlist for download script execution without arguments
This commit is contained in:
+17
-8
@@ -39,20 +39,29 @@ const blocklistUrls = [
|
|||||||
];
|
];
|
||||||
const listType = process.argv[2];
|
const listType = process.argv[2];
|
||||||
|
|
||||||
|
const downloadAllowlists = async () => {
|
||||||
|
await downloadFiles(resolve("./allowlist.txt"), allowlistUrls);
|
||||||
|
console.log(
|
||||||
|
"Done. The allowlist.txt file contains merged data from recommended whitelists."
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const downloadBlocklists = async () => {
|
||||||
|
await downloadFiles(resolve("./blocklist.txt"), blocklistUrls);
|
||||||
|
console.log(
|
||||||
|
"Done. The blocklist.txt file contains merged data from recommended filter lists."
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
switch (listType) {
|
switch (listType) {
|
||||||
case "allowlist": {
|
case "allowlist": {
|
||||||
await downloadFiles(resolve("./allowlist.txt"), allowlistUrls);
|
await downloadAllowlists();
|
||||||
console.log(
|
|
||||||
"Done. The allowlist.txt file contains merged data from recommended whitelists."
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "blocklist": {
|
case "blocklist": {
|
||||||
await downloadFiles(resolve("./blocklist.txt"), blocklistUrls);
|
await downloadBlocklists();
|
||||||
console.log(
|
|
||||||
"Done. The blocklist.txt file contains merged data from recommended filter lists."
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
await Promise.all([downloadAllowlists(), downloadBlocklists()]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user