-
Notifications
You must be signed in to change notification settings - Fork 1
/
upgrade_openweb.sh
37 lines (27 loc) · 1002 Bytes
/
upgrade_openweb.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
#!/bin/bash
# Check the status of the service
# Change to the application directory
echo "Changing to /usr/openweb/ directory..."
cd /usr/openweb/ || { echo "Failed to change directory to /usr/openweb/"; exit 1; }
# Stop the service before upgrading
echo "Stopping run_script.service..."
sudo systemctl stop run_script.service
# Backup the current configuration
echo "Backing up config.json..."
cp ./venv/lib64/python3.11/site-packages/data/webui.db /usr/webui.old
# Activate the virtual environment
echo "Activating the virtual environment..."
source ./venv/bin/activate
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Upgrade open-webui
echo "Upgrading open-webui..."
pip install --upgrade open-webui
# Check the new version of open-webui
echo "Checking the new version of open-webui..."
pip show open-webui
# Restart the service after upgrades
echo "Starting run_script.service..."
sudo systemctl start run_script.service
echo "Upgrade process completed successfully!"