File size: 943 Bytes
4be1dd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Ask for confirmation to proceed with the update
read -r -p "Do you want to update Douyin_TikTok_Download_API? [y/n] " input
case $input in
    [yY])
        # Navigate to the project directory or exit if it fails
        cd /www/wwwroot/Douyin_TikTok_Download_API || { echo "The directory does not exist."; exit 1; }

        # Pull the latest changes from the repository
        git pull

        # Activate the virtual environment
        source venv/bin/activate

        # Optionally, update Python dependencies
        pip install -r requirements.txt

        # Deactivate the virtual environment
        deactivate

        # Restart the service to apply changes
        echo "Restarting Douyin_TikTok_Download_API service"
        sudo systemctl restart Douyin_TikTok_Download_API.service
        echo "Successfully restarted all services!"
        ;;
    [nN]|*)
        echo "Exiting..."
        exit 1
        ;;
esac