-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdate.sh
49 lines (36 loc) · 884 Bytes
/
update.sh
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
#!/bin/bash
NOCOLOR="\033[0m"
GREEN="\033[0;32m"
echo -e "\n${GREEN}Updating...${NOCOLOR}\n"
if [ $# -eq 1 ]; then
bot=$1
else
read -r -p "Choose a object: " bot
fi
echo "------------------------"
echo -e "\n${GREEN}Updating the scripts...${NOCOLOR}\n"
cd ~/scp-079/scripts || exit
git pull
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
source venv/bin/activate
pip install -U pip
pip install -U setuptools wheel
pip install -r requirements.txt
deactivate
# shellcheck source=./env.sh
source ~/scp-079/scripts/env.sh
if [ "$bot" = "scripts" ]; then
echo -e "\n${GREEN}Scripts Updated!${NOCOLOR}\n"
exit
fi
cd ~/scp-079/"$bot" || exit
git pull
source venv/bin/activate
pip install -U pip
pip install -U setuptools wheel
pip install -r requirements.txt
deactivate
systemctl --user restart "$bot"
echo -e "\n${GREEN}Bot ${bot^^} Updated!${NOCOLOR}\n"