Added config file, improved setup and updater scripts.

This commit is contained in:
2023-05-18 16:56:49 +02:00
parent 7b297b75be
commit 530fff24ea
7 changed files with 35 additions and 13 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
vpn/
Microsoft-Rewards-bot/
Microsoft-Rewards-bot/
config.txt

View File

@@ -28,13 +28,13 @@ Clone the project
curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-fedora.sh | bash
```
Add your VPN files to `./vpn` then run
Add your VPN files (.ovpn) to `./vpn` then run
```bash
sh setup-vpn.sh
```
Copy your accounts file named as [vpnname].json in the Bot then run
Copy your accounts file named as [vpnname].json in the Bot folder then run
```bash
sh start.sh

4
config.txt.sample Normal file
View File

@@ -0,0 +1,4 @@
interval=300
schedule=("01:00" "03:15" "05:30" "07:45" "10:00" "12:15" "14:30" "16:45" "19:00" "21:15")
retries=3
webhook=''

View File

@@ -6,5 +6,10 @@ git clone https://git.justw.tf/Lightemerald/mcr-bot && cd mcr-bot
git clone https://github.com/farshadz1997/Microsoft-Rewards-bot
pip install -r Microsoft-Rewards-bot/requirements.txt
mkdir vpn
cp ./config.txt.sample config.txt
chmod +x ./*.sh
clear
echo "Add your VPN files in ./vpn and your accounts files with the same name as the vpn in ./Microsoft-Rewards-bot then run setup-vpn.sh"
echo "edit config.txt"
echo "Add your VPN files (.ovpn) in ./vpn"
echo "Add your accounts files (.json) with the same name as the vpn in ./Microsoft-Rewards-bot"
echo "finally run setup-vpn.sh"

View File

@@ -16,11 +16,15 @@ then
exit
fi
interval=300
schedule=("06:00" "08:00" "10:00" "12:00" "14:00" "16:00" "18:00" "20:00")
vpns=$(nmcli connection show | grep vpn | awk '{print $1}')
retries=3
webhook=''
config_file="config.txt"
if [ -f "$config_file" ]; then
source "$config_file"
else
echo "Config file not found."
exit 1
fi
while true
do

View File

@@ -16,11 +16,15 @@ then
exit
fi
interval=300
schedule=("06:00" "08:00" "10:00" "12:00" "14:00" "16:00" "18:00" "20:00")
vpns=$(nmcli connection show | grep vpn | awk '{print $1}')
retries=3
webhook=''
config_file="config.txt"
if [ -f "$config_file" ]; then
source "$config_file"
else
echo "Config file not found."
exit 1
fi
while true
do

View File

@@ -1 +1,5 @@
git pull
dnf up -y
git pull
cd Microsoft-Rewards-bot && git pull
clear
echo "Update done!"