From bcf5e878016aeb336f52c3eb46050e9086a2ff3b Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Mon, 19 Jun 2023 10:28:53 +0200 Subject: [PATCH] Removed setup fedora, added support for debian, fedora and arch based distro --- README.md | 6 +++--- setup-fedora.sh | 15 --------------- setup-linux.sh | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 18 deletions(-) delete mode 100644 setup-fedora.sh create mode 100644 setup-linux.sh diff --git a/README.md b/README.md index 0174d72..bb8b78f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe ```bash ├── start.sh -├── setup-fedora.sh +├── setup-linux.sh ├── setup-vpn.sh ├── update.sh ├── Microsoft-Rewards-bot @@ -25,7 +25,7 @@ This repo contains the script to manage multiple mcr bot on a single VM/Containe Clone the project ```bash -curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-fedora.sh | bash +curl -sSL https://git.justw.tf/Lightemerald/mcr-bot/raw/branch/main/setup-linux.sh | bash ``` Add your VPN files (.ovpn) to `./vpn` then run @@ -42,7 +42,7 @@ 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 +Execute this command to allow the container to use TUN kernel module (needed for openvpn), 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 ``` diff --git a/setup-fedora.sh b/setup-fedora.sh deleted file mode 100644 index 199793c..0000000 --- a/setup-fedora.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -sudo dnf up -y -sudo dnf in nano NetworkManager NetworkManager-openvpn openvpn python python*-pip python*-tkinter chromedriver chromium xorg-x11-server-Xvfb git wget unzip -y -git clone https://git.justw.tf/Lightemerald/mcr-bot && cd mcr-bot -git clone https://github.com/farshadz1997/Microsoft-Rewards-bot && cd Microsoft-Rewards-bot && git checkout 03476776e9c58029dedaeee431958b5d04364bcf && pip install -r requirements.txt -cd .. && mkdir vpn -cp ./config.txt.sample config.txt -chmod +x ./*.sh -clear -echo "edit config.txt" -echo "Add your VPN files (.ovpn) in ./vpn" -echo "Then run setup-vpn.sh" -echo "Add your accounts files (.json) with the same name as the vpn in ./Microsoft-Rewards-bot" -echo "Finally run start.sh" \ No newline at end of file diff --git a/setup-linux.sh b/setup-linux.sh new file mode 100644 index 0000000..3f2d841 --- /dev/null +++ b/setup-linux.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -e + +update_package_manager() { + if command -v apt-get &>/dev/null; then + echo "Detected APT package manager." + sudo apt-get update && sudo apt-get upgrade -y + elif command -v dnf &>/dev/null; then + echo "Detected DNF package manager." + sudo dnf update -y + elif command -v pacman &>/dev/null; then + echo "Detected Pacman package manager." + sudo pacman -Syu --noconfirm + else + echo "Unable to detect the package manager." + exit 1 + fi +} + +install_requirements() { + if command -v apt-get &>/dev/null; then + sudo apt install chromium chromium-driver network-manager network-manager-openvpn openvpn python3 python3-pip python3-tk xvfb git wget unzip nano -y + elif command -v dnf &>/dev/null; then + sudo dnf install chromium chromium-driver NetworkManager NetworkManager-openvpn openvpn python python*-pip python*-tkinter xorg-x11-server-Xvfb git wget unzip nano -y + elif command -v pacman &>/dev/null; then + sudo pacman -Sy chromium networkmanager networkmanager-openvpn openvpn python python-pip xorg-server-xvfb git wget unzip nano --noconfirm + fi +} + +update_package_manager +install_requirements + +git clone https://git.justw.tf/Lightemerald/mcr-bot && cd mcr-bot +git clone https://github.com/farshadz1997/Microsoft-Rewards-bot && cd Microsoft-Rewards-bot && git checkout 03476776e9c58029dedaeee431958b5d04364bcf && pip install -r requirements.txt +cd .. && mkdir vpn +cp ./config.txt.sample config.txt +chmod +x ./*.sh +clear +echo -e "Edit config.txt\nAdd your VPN files (.ovpn) in ./vpn\nThen run setup-vpn.sh\nAdd your accounts files (.json) with the same name as the VPN in ./Microsoft-Rewards-bot\nFinally, run start.sh" \ No newline at end of file