-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
46 lines (39 loc) · 1.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { initWatcher } from "./init.js";
import { watchForHackerone } from "./watchers/hackerone.js";
import { watchForIntigriti } from "./watchers/intigriti.js";
import { watchForYeswehack } from "./watchers/yeswehack.js";
import { watchForBugCrowd } from "./watchers/bugcrowd.js";
import { watchForFederacy } from "./watchers/federacy.js";
import { program } from "commander";
import { cronSchedule } from "./helper/cronScheduler.js";
const watchAll = async () => {
await watchForHackerone();
await watchForBugCrowd();
await watchForIntigriti();
//await watchForYeswehack();
//await watchForFederacy()
};
program
.option("-i, --init", "Run seeder function")
.option("-w, --watch", "watch for changes in bounty platforms")
.option(
"-c, --cronjob <value>",
"Set desired cronjob value (e.g. -c 2h, -c 1d, or -c 30m)"
)
.parse(process.argv);
const { init, watch, cronjob } = program.opts();
async function main() {
if (init) {
console.info("[+] Running the init function...");
initWatcher();
return;
}
if (cronjob) {
console.log(`[+] Starting the cronjob ${cronjob}`);
cronSchedule(cronjob, watchAll);
} else {
console.info("Pleaser provide your cronjob in order to run the tool.");
process.exit(1);
}
}
main();