Compare commits

7 Commits
main ... legacy

Author SHA1 Message Date
d7e620c1a7 Update 'README.md' 2023-06-29 12:05:52 +00:00
5fbb891245 typo fix 2023-06-25 10:14:26 +02:00
6d53970dba Fix update 2023-06-23 13:22:50 +02:00
20f0f09e31 Changed accounts folder. 2023-06-22 14:54:38 +02:00
c77f90e951 Updated to mirror and fixes 2023-06-22 14:48:36 +02:00
fadb558f75 Switched to legacy branch 2023-06-20 14:01:58 +00:00
c5e10a8592 Edited README to reflect branch version 2023-06-20 13:50:50 +00:00
6 changed files with 50 additions and 19 deletions

View File

@@ -11,8 +11,10 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe
├── update.sh ├── update.sh
├── Microsoft-Rewards-bot ├── Microsoft-Rewards-bot
│ ├── ms_rewards_farmer.py │ ├── ms_rewards_farmer.py
│ ├── vpnname1.json │ ├── ...
│ ├── vpnname2.json ├── accounts
│ ├── name1.json
│ ├── name2.json
│ ├── ... │ ├── ...
├── vpn ├── vpn
│ ├── vpnname1.ovpn │ ├── vpnname1.ovpn
@@ -25,10 +27,10 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe
Start the setup script with either curl, wget or by pasting script content to your terminal. Start the setup script with either curl, wget or by pasting script content to your terminal.
```bash ```bash
curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-linux.sh | bash curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/legacy/setup-linux.sh | bash
``` ```
```bash ```bash
wget -O- https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-linux.sh | bash wget -O- https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/legacy/setup-linux.sh | bash
``` ```
Add your VPN files (.ovpn) to `./vpn` then run Add your VPN files (.ovpn) to `./vpn` then run

View File

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

View File

@@ -41,8 +41,8 @@ install_requirements() {
update_package_manager update_package_manager
install_requirements install_requirements
git clone https://git.justw.tf/Lightemerald/mcr-bot && cd mcr-bot git clone https://git.justw.tf/Lightemerald/mcr-bot && cd mcr-bot && git checkout legacy
git clone https://github.com/farshadz1997/Microsoft-Rewards-bot && cd Microsoft-Rewards-bot && git checkout 03476776e9c58029dedaeee431958b5d04364bcf && pip install -r requirements.txt git clone https://git.justw.tf/Lightemerald/Microsoft-Rewards-bot && cd Microsoft-Rewards-bot && pip install -r requirements.txt
cd .. && mkdir vpn cd .. && mkdir vpn
cp ./config.txt.sample config.txt cp ./config.txt.sample config.txt
chmod +x ./*.sh chmod +x ./*.sh

View File

@@ -1,9 +1,14 @@
#!/bin/bash #!/bin/bash
folder_path="vpn" vpn_connections=$(nmcli connection show | grep vpn | awk '{print $1}')
for vpn in $vpn_connections; do
nmcli connection delete "$vpn"
done
folder_path="vpn"
for file in "$folder_path"/*; do for file in "$folder_path"/*; do
if [[ -f "$file" ]]; then if [[ -f "$file" ]]; then
nmcli con import type openvpn file ./$file nmcli con import type openvpn file ./"$file"
fi fi
done done

View File

@@ -37,7 +37,7 @@ function send_webhook() {
echo "$message" echo "$message"
else else
echo "$message" echo "$message"
curl --silent -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"$message\", \"username\": \"mMicrosoft Rewards Bot Manager\"}" "$webhook" curl --silent -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"$message\", \"username\": \"Microsoft Rewards Bot Manager\"}" "$webhook"
fi fi
} }
@@ -123,21 +123,21 @@ do
then then
ip=$(curl -s https://api.ipify.org) ip=$(curl -s https://api.ipify.org)
send_webhook "[$host] VPN connection successfully established (IP: $ip).\nStarting script..." send_webhook "[$host] VPN connection successfully established (IP: $ip).\nStarting script..."
if [ -f "./Microsoft-Rewards-bot/$vpn.json" ] if [ -f "./accounts/$vpn.json" ]
then then
if [ -z "$webhook" ]; then if [ -z "$webhook" ]; then
command_suffix="--accounts-file $vpn.json" command_suffix="--accounts-file $vpn.json"
else else
if [[ "$log_all" == 1 ]]; then if [[ "$print_log_to_webhook" == 1 ]]; then
command_suffix="--accounts-file $vpn.json --discord $webhook --print-to-webhook" command_suffix="--accounts-file ../accounts/$vpn.json --discord $webhook --print-to-webhook"
else else
command_suffix="--accounts-file $vpn.json --discord $webhook" command_suffix="--accounts-file ../accounts/$vpn.json --discord $webhook"
fi fi
fi fi
if grep -q "container=lxc" /proc/1/environ || grep -q "container=lxc-libvirt" /proc/1/environ; then if grep -q "container=lxc" /proc/1/environ || grep -q "container=lxc-libvirt" /proc/1/environ; then
command_prefix="cd Microsoft-Rewards-bot && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --skip-unusual --virtual-display" command_prefix="cd Microsoft-Rewards-bot && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --browser uc --skip-unusual --virtual-display"
else else
command_prefix="cd Microsoft-Rewards-bot && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --skip-unusual" command_prefix="cd Microsoft-Rewards-bot && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --browser uc --skip-unusual"
fi fi
gnome-terminal -- sh -c "$command_prefix $command_suffix; exit; exec bash" & gnome-terminal -- sh -c "$command_prefix $command_suffix; exit; exec bash" &
read -t 2 read -t 2

View File

@@ -1,6 +1,30 @@
#!/bin/bash
git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse "@{u}")" ]; then
git stash && git pull
cd .. && chmod +x ./*.sh
exec "$0"
fi
if [ ! -d "accounts" ]; then
mkdir "accounts"
fi
if [ ! -d "vpn" ]; then
mkdir "vpn"
fi
if [ ! -d "Microsoft-Rewards-bot" ]; then
git clone https://git.justw.tf/Lightemerald/Microsoft-Rewards-bot
fi
sudo dnf up -y sudo dnf up -y
git stash && git pull cd Microsoft-Rewards-bot && git fetch
cd Microsoft-Rewards-bot && git stash && git pull && git checkout 03476776e9c58029dedaeee431958b5d04364bcf && pip install -r requirements.txt if [ "$(git rev-parse HEAD)" != "$(git rev-parse "@{u}")" ]; then
clear git stash && git pull && pip install -r requirements.txt
fi
cd .. && chmod +x ./*.sh cd .. && chmod +x ./*.sh
clear
echo "Update done!" echo "Update done!"