-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
112 lines (104 loc) Β· 3.92 KB
/
Copy pathinstall.sh
File metadata and controls
112 lines (104 loc) Β· 3.92 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# Base made through ChatGPT
# Set an environment variable based on the operating system
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Check for specific Linux distributions
if [[ -f /etc/arch-release ]]; then
# Install packages on Arch Linux
echo "Detect OS :- Arch Linux"
sleep 3
sudo pacman -Syu --noconfirm ffmpeg nodejs-lts-hydrogen git imagemagick npm
sudo npm install --global yarn
clear
elif [[ -f /etc/fedora-release ]]; then
# Install packages on Fedora
echo "Detect OS :- Fedora Linux"
sleep 3
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y ffmpeg nodejs git ImageMagick yarnpkg
clear
elif [[ -f /etc/lsb-release && "$(cat /etc/lsb-release | grep DISTRIB_ID)" == *"Ubuntu"* ]]; then
# Install packages on Ubuntu
echo "Detect OS :- Ubuntu Linux"
sleep 3
sudo apt-get update
sudo apt-get install -y ffmpeg git curl imagemagick
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install --global yarn
npm install --global yarn
clear
elif [[ -f /etc/debian_version ]]; then
# Install packages on Debian
echo "Detect OS :- Debian Linux"
sleep 3
sudo apt-get update
sudo apt-get install -y ffmpeg git curl imagemagick
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install --global yarn
npm install --global yarn
clear
elif [[ -f /etc/redhat-release ]]; then
# Install packages on Red Hat
echo "Detect OS :- RedHat Linux"
sleep 3
sudo yum install -y ffmpeg nodejs git ImageMagick yarnpkg
clear
else
echo "Unknown Linux distribution"
exit 1
fi
elif [[ "$OSTYPE" == "linux-android"* ]]; then
# Install packages on Termux
pkg install -y ffmpeg nodejs git imagemagick libwebp yarn
clear
elif [[ "$OSTYPE" == "linux"* ]]; then
if [[ -f /etc/os-release && "$(cat /etc/os-release | grep ID_LIKE)" == *"suse"* ]]; then
# Install packages on openSUSE
echo "Detect OS :- openSUSE Linux"
sleep 3
sudo zypper install -y ffmpeg-5 nodejs18 git ImageMagick
sudo zypper install -y nodejs18 git ImageMagick ffmpeg-4
sudo npm install --global yarn
clear
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Install packages on macOS
brew install ffmpeg nodejs git imagemagick yarn
clear
else
echo "Unsupported operating system"
exit 1
fi
# Clone the Nezuko repository
echo "Copying Nezuko Script π"
git clone https://github.com/EternityBots/Nezuko.git
# Change into the Nezuko directory
cd Nezuko
# Install dependencies using yarn
yarn install
clear
# Prompt the user to set environment variables
read -p "Enter MongoDB URI: " MONGODB_URI
read -p "Enter your mobile number: " NUM
read -p "Enter bot prefix: " BOT_PREFIX
read -p "Enter session ID: " SESSION_ID
read -p "Enter Google API key: " GOOGLE_API_KEY
read -p "Enter weatherapi.com API key: " WEATHER_API_KEY
read -p "Enter MyAnimeList username: " MAL_USERNAME
read -p "Enter MyAnimeList password: " MAL_PASSWORD
# Set environment variables
echo "MONGODB=$MONGODB_URI" > .env
echo "MODS=$NUM" >> .env
echo "PREFIX=$BOT_PREFIX" >> .env
echo "SESSION_ID=$SESSION_ID" >> .env
echo "GOOGLE_API=$GOOGLE_API_KEY" >> .env
echo "WEATHER_API=$WEATHER_API_KEY" >> .env
echo "MAL_USERNAME=$MAL_USERNAME" >> .env
echo "MAL_PASSWORD=$MAL_PASSWORD" >> .env
echo "β
Environment variables set successfully"
clear
# Start the Nezuko bot
echo "Starting Nezuko Bot πππππππππ"
sudo bash loop.sh