This commit is contained in:
CanbiZ 2025-09-15 09:41:03 +02:00
parent ba50e15942
commit 5a68fb7ce2
2 changed files with 30 additions and 33 deletions

View File

@ -20,40 +20,37 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/scraparr/ ]]; then if [[ ! -d /opt/scraparr/ ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/thecfu/scraparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f "${HOME}/.scrappar" ]] || [[ "${RELEASE}" != "$(cat "${HOME}"/.scrappar)" ]]; then
msg_info "Stopping Services"
systemctl stop scraparr
msg_ok "Services Stopped"
PYTHON_VERSION="3.12" setup_uv
fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/scraparr || exit
$STD uv venv /opt/scraparr/.venv
$STD /opt/scraparr/.venv/bin/python -m ensurepip --upgrade
$STD /opt/scraparr/.venv/bin/python -m pip install --upgrade pip
$STD /opt/scraparr/.venv/bin/python -m pip install -r /opt/scraparr/src/scraparr/requirements.txt
chmod -R 755 /opt/scraparr
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting Services"
systemctl start scraparr
msg_ok "Services Started"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit exit
fi
if check_for_gh_release "scraparr" "thecfu/scraparr"; then
msg_info "Stopping Services"
systemctl stop scraparr
msg_ok "Services Stopped"
PYTHON_VERSION="3.12" setup_uv
fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr"
msg_info "Updating Scraparr"
cd /opt/scraparr
$STD uv venv /opt/scraparr/.venv
$STD /opt/scraparr/.venv/bin/python -m ensurepip --upgrade
$STD /opt/scraparr/.venv/bin/python -m pip install --upgrade pip
$STD /opt/scraparr/.venv/bin/python -m pip install -r /opt/scraparr/src/scraparr/requirements.txt
chmod -R 755 /opt/scraparr
msg_ok "Updated Scraparr"
msg_info "Starting Services"
systemctl start scraparr
msg_ok "Services Started"
msg_ok "Updated Successfully"
fi
exit
} }
start start

View File

@ -13,7 +13,7 @@ setting_up_container
network_check network_check
update_os update_os
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.13" setup_uv
fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr" fetch_and_deploy_gh_release "scrappar" "thecfu/scraparr" "tarball" "latest" "/opt/scraparr"
msg_info "Installing Scraparr" msg_info "Installing Scraparr"