-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupgrade.sh
43 lines (33 loc) · 1003 Bytes
/
upgrade.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
#!/bin/bash
NOCOLOR="\033[0m"
GREEN="\033[0;32m"
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
shopt -s nullglob
for bot in ~/scp-079/*; do
bot=$(basename "$bot")
if [ "$bot" != "scripts" ] && [ "$bot" != "venv" ] && ! [[ "$bot" =~ ^(conda)$ ]]; then
echo -e "\n${GREEN}Updating the bot ${bot^^}...${NOCOLOR}\n"
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"
fi
done
shopt -u nullglob