-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathvps.sh
More file actions
29 lines (23 loc) · 836 Bytes
/
vps.sh
File metadata and controls
29 lines (23 loc) · 836 Bytes
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
#!/bin/bash
# Update & upgrade system
apt update && apt upgrade -y
apt install -y git python3 python3-venv python3-pip tmux
# Clone the repo
if [ -z $UPSTREAM_REPO ]; then
echo "Cloning main Repository"
git clone https://github.com/MrMKN/PROFESSOR-BOT /ProfessorBot
else
echo "Cloning Custom Repo from $UPSTREAM_REPO"
git clone $UPSTREAM_REPO /ProfessorBot
fi
# Create and activate virtual environment
cd /ProfessorBot
python3 -m venv venv
source venv/bin/activate
# Upgrade pip and install requirements
pip install -U pip
pip install -U -r requirements.txt --force-reinstall
# Start bot in a tmux session
echo "Starting Bot in tmux session 'professorbot'....✨"
tmux new-session -d -s professorbot 'source venv/bin/activate && python3 bot.py'
echo "Bot is running inside tmux. Use: tmux attach -t professorbot"