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 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) {
|
||||
case "allowlist": {
|
||||
await downloadFiles(resolve("./allowlist.txt"), allowlistUrls);
|
||||
console.log(
|
||||
"Done. The allowlist.txt file contains merged data from recommended whitelists."
|
||||
);
|
||||
await downloadAllowlists();
|
||||
break;
|
||||
}
|
||||
case "blocklist": {
|
||||
await downloadFiles(resolve("./blocklist.txt"), blocklistUrls);
|
||||
console.log(
|
||||
"Done. The blocklist.txt file contains merged data from recommended filter lists."
|
||||
);
|
||||
await downloadBlocklists();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
await Promise.all([downloadAllowlists(), downloadBlocklists()]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user