add dependincies update to the update function
This commit is contained in:
@ -39,6 +39,19 @@ function update_script() {
|
||||
systemctl stop huntarr
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
# Update system dependencies
|
||||
msg_info "Checking system dependencies"
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y \
|
||||
curl \
|
||||
tar \
|
||||
unzip \
|
||||
jq \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-venv
|
||||
msg_ok "System dependencies updated"
|
||||
|
||||
# Creating Backup - maintain only one backup file
|
||||
msg_info "Creating Backup"
|
||||
# Remove any existing backups
|
||||
@ -57,8 +70,27 @@ function update_script() {
|
||||
cp -rf "/tmp/Huntarr.io-${RELEASE}"/* /opt/huntarr/
|
||||
|
||||
# Update Python dependencies
|
||||
msg_info "Updating Python dependencies"
|
||||
cd /opt/huntarr || exit
|
||||
/opt/huntarr/venv/bin/pip install -r requirements.txt
|
||||
# Check if requirements changed with md5sum
|
||||
if [[ -f "/opt/huntarr/.requirements_checksum" ]]; then
|
||||
CURRENT_CHECKSUM=$(md5sum requirements.txt | awk '{print $1}')
|
||||
STORED_CHECKSUM=$(cat .requirements_checksum)
|
||||
|
||||
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
|
||||
msg_info "Requirements have changed. Performing full upgrade."
|
||||
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
|
||||
else
|
||||
msg_info "Requirements unchanged. Verifying installation."
|
||||
/opt/huntarr/venv/bin/pip install -r requirements.txt
|
||||
fi
|
||||
else
|
||||
# First time update
|
||||
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
|
||||
fi
|
||||
# Store new checksum
|
||||
md5sum requirements.txt | awk '{print $1}' >.requirements_checksum
|
||||
msg_ok "Updated Python dependencies"
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
|
||||
# Starting Services
|
||||
|
||||
Reference in New Issue
Block a user