-
Notifications
You must be signed in to change notification settings - Fork 4
/
upgrade.sh
executable file
·46 lines (44 loc) · 1.45 KB
/
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
44
45
46
#!/bin/bash
# Copyright (C) 2024 by the CAM-AI team, info@cam-ai.de
# More information and complete source: https://github.com/ludgerh/cam-ai
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
validate() {
grep -F -q -x "$1" <<EOF
raspi11
raspi12
debian10
debian12
debian
EOF
}
if validate $1; then
rm -rf backup
mv cam-ai backup
git clone https://github.com/ludgerh/cam-ai
mv backup/camai/passwords.py cam-ai/camai/
mv backup/plugins/ cam-ai/plugins
mv backup/data/ cam-ai/data
cd cam-ai
source env/bin/activate
pip install --upgrade pip
cp requirements.$1 requirements.txt
pip install -r requirements.txt
python manage.py migrate
cp upgrade.sh ..
chmod u+x ../upgrade.sh
cd ..
echo "Upgrade is done"
else
echo "Usage: upgrade [OSTYPE]"
echo "OSTYPE in raspi11, raspi12, debian10, debian12"
fi