-
Notifications
You must be signed in to change notification settings - Fork 21
/
run.sh
41 lines (30 loc) · 1.16 KB
/
run.sh
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
#!/bin/bash
# Setup environment
source /home/emailabuseverify/virtualenv/disposable-email-domain-list/3.8/bin/activate && cd /home/emailabuseverify/disposable-email-domain-list
# pip install -r requirements.txt
# run python script
python3 main.py
# # Check if the domains.txt has at least 1000 lines
lines=$(wc -l < domains.txt)
if [ $lines -lt 1000 ]; then
echo "domains.txt does not have at least 1000 rows. Exiting..."
exit 1
fi
# Git commit and push
timestamp=$(date)
#cd /path/to/your/repository
# Set GIT credentials (replace with your own)
git config --global user.name "Auto Updater"
git config --global user.email ""
export GIT_USERNAME=""
export GIT_TOKEN="" # your personal access token
git fetch https://$GIT_USERNAME:[email protected]/groundcat/disposable-email-domain-list.git
# Commit changes
git add domains.txt
git add domains.json
git commit -m "[$timestamp] - MX validated and updated domains"
# Set remote URL with access token
git remote set-url origin https://$GIT_USERNAME:[email protected]/groundcat/disposable-email-domain-list.git
# Push to GitHub
git push origin master
echo "Updated domains.txt committed and pushed to repository."