-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubalarm.sh
More file actions
25 lines (18 loc) · 725 Bytes
/
subalarm.sh
File metadata and controls
25 lines (18 loc) · 725 Bytes
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
#!/bin/bash
iterationcount=$(cat runcount.txt)
while true;
do
subfinder -silent -dL targetdomainlist.txt -all | sort > subop1.txt
diff subop.txt subop1.txt | grep '^>' | sed 's/^> //' > newsubdomains.txt
subcount=$(cat newsubdomains.txt | wc -l)
if [ "$subcount" -ne 0 ]; then
echo " telegram_format: 'You have $subcount new subdomains. The new subdomains are: {{data}}'" >> config.yaml && notify -pc config.yaml -silent -data newsubdomains.txt -provider telegram -bulk;
fi
head -n 5 config.yaml > temp.txt && mv temp.txt config.yaml
cat newsubdomains.txt >> subop.txt
((iterationcount++))
cat subop.txt | sort > temp.txt;
cp temp.txt subop.txt;
echo "$iterationcount" > runcount.txt
sleep 3600
done