From e4fdd519248b36ef6ac5f0365b6a48d24cf67308 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Sat, 13 May 2023 17:42:26 +0200 Subject: [PATCH] Added LXC support, Fedora setup script, auto vpn add script, updated README --- README.md | 26 ++++++++++++++++---------- setup-fedora.sh | 10 ++++++++++ setup-vpn.sh | 9 +++++++++ start.sh | 2 +- 4 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 setup-fedora.sh create mode 100644 setup-vpn.sh diff --git a/README.md b/README.md index d08afe7..2c263a1 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,11 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe ```bash ├── start.sh -│ ├── bot-name-1 +│ ├── Microsoft-Rewards-bot │ │ ├── ms_rewards_farmer.py -│ ├── bot-name-2 -│ │ ├── ms_rewards_farmer.py -│ ├── bot-name-3 -│ │ ├── ms_rewards_farmer.py -│ ├── ... +│ │ ├── vpnname.json +│ ├── vpn +│ │ ├── vpnname.ovpn ``` ## How to run @@ -20,17 +18,25 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe Clone the project ```bash - git clone https://git.justw.tf/Lightemerald/mcr-bot + curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-fedora.sh | bash ``` -Go to the project directory +Add your VPN files to `./vpn` then run ```bash - cd mcr-bot + sh setup-vpn.sh ``` -Copy your bots with the same name as the VPN then run the script +Copy your accounts file named as [vpnname].json in the Bot then run ```bash sh start.sh ``` + +### If using LXC + +Execute this command to allow the container to use TUN kernel module, replace [id_ct] with the LXC id in proxmox +```bash + echo -e "lxc.cgroup.devices.allow: c 10:200 rwm\nlxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file" >> /etc/pve/lxc/[id_ct].conf +``` +ps: container must be powered off before and restarted only after \ No newline at end of file diff --git a/setup-fedora.sh b/setup-fedora.sh new file mode 100644 index 0000000..2beb855 --- /dev/null +++ b/setup-fedora.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +dnf up -y +dnf in NetworkManager NetworkManager-openvpn openvpn python python-pip python-tkinter chromedriver chromium xorg-x11-server-Xvfb git -y +git clone https://git.justw.tf/Lightemerald/mcr-bot +cd mrc-bot +git clone https://github.com/farshadz1997/Microsoft-Rewards-bot +pip install -r Microsoft-Rewards-bot/requirements.txt +mkdir vpn +echo "Add your VPN files in ./vpn and your accounts file with the same name as the vpn in ./Microsoft-Rewards-bot then run setup-vpn.sh" \ No newline at end of file diff --git a/setup-vpn.sh b/setup-vpn.sh new file mode 100644 index 0000000..7f49543 --- /dev/null +++ b/setup-vpn.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +folder_path="vpn" + +for file in "$folder_path"/*; do + if [[ -f "$file" ]]; then + nmcli con import type openvpn file "$file" + fi +done \ No newline at end of file diff --git a/start.sh b/start.sh index 6a70b2c..b6f72aa 100644 --- a/start.sh +++ b/start.sh @@ -85,7 +85,7 @@ do echo "Starting script..." if [ -d "./$vpn" ] then - gnome-terminal -- sh -c "cd ./$vpn && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --discord $webhook; exit; exec bash" & + gnome-terminal -- sh -c "cd Microsoft-Rewards-bot && python ms_rewards_farmer.py --dont-check-for-updates --shuffle --session --superfast --on-finish exit --no-webdriver-manager --accounts-file $vpn.json --discord $webhook; exit; exec bash" & read -t 2 echo "Script started" read -t 1