add qbittorrent version check to upgrade script

This commit is contained in:
lucas committed 2026-10-06 13:45:11 +02:00
1 parent 1d2c57dc02
commit 2ee909e6bb
1 file changed
+65 -3
+65 -3
View File
@@ -41,6 +41,18 @@
###############################################################################
set -o pipefail
usage() {
cat <<EOF
Usage: ${0##*/} [OPTIONS]
Update apt pythoni flatpak and docker
Options:
-h, --help Show this help message and exit
--version Show script version
EOF
}
home_dir="/home/lucas"
venv_dir="${home_dir}/tools/spotdl_venv"
@@ -50,6 +62,46 @@ red="\e[31m"
norm="\e[0m"
MAIL=false
BUILD=false
die() {
echo "Error: $*" >&2
echo
usage >&2
exit 2
}
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
usage
exit 0
;;
--version)
echo "${0##*/} 1.0"
exit 0
;;
--build)
BUILD=true
shift 1;
;;
--mail)
MAIL=true
shift 1;
;;
-*)
die "Unknown option: $1"
;;
*)
die "Unexpected argument: $1"
;;
esac
shift
done
}
write_out() {
if [[ "${MAIL}" == "true" ]]; then
@@ -227,9 +279,19 @@ if command -v docker >/dev/null 2>&1; then
qbittorrent-qbittorrent:*)
echo "Updating custom qBittorrent image..."
(
cd /docker/qbittorrent &&
docker compose build --pull &&
docker compose up -d
latest="$(curl -s https://api.github.com/repos/qbittorrent/qBittorrent/releases/latest | grep '"tag_name"' | cut -d '"' -f 4 | cut -d '-' -f2)"
current="$(docker exec -it qbittorrent /app/qbittorrent-nox -v | cut -d 'v' -f2)"
if [[ "$LATEST" != "$CURRENT" && "$BUILD" == "true" ]]; then
echo "New version available: $CURRENT -> $LATEST"
cd /docker/qbittorrent &&
docker compose build --pull &&
docker compose up -d
elif [[ "$LATEST" != "$CURRENT" ]]; then
echo "New version available: $CURRENT -> $LATEST"
echo "BUILD is turend off"
else
echo "No new version available: $CURRENT == $LATEST"
fi
)
;;
*"<none>"*)