diff --git a/ct/2fauth.sh b/ct/2fauth.sh index 4699427561..cf9308d635 100644 --- a/ct/2fauth.sh +++ b/ct/2fauth.sh @@ -28,12 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Bubka/2FAuth/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.2fauth 2>/dev/null)" ]] || [[ ! -f ~/.2fauth ]]; then - msg_info "Updating $APP to ${RELEASE}" + if check_for_gh_release "2fauth" "Bubka/2FAuth"; then $STD apt-get update $STD apt-get -y upgrade @@ -64,18 +59,13 @@ function update_script() { $STD systemctl restart nginx msg_info "Cleaning Up" - rm -rf "v${RELEASE}.zip" if dpkg -l | grep -q 'php8.2'; then $STD apt-get remove --purge -y php8.2* fi $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleanup Completed" - - echo "${RELEASE}" >/opt/2fauth_version.txt - msg_ok "Updated $APP to ${RELEASE}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/adventurelog.sh b/ct/adventurelog.sh index 153408d55e..08d079769f 100644 --- a/ct/adventurelog.sh +++ b/ct/adventurelog.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/seanmorley15/AdventureLog/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.adventurelog 2>/dev/null)" ]] || [[ ! -f ~/.adventurelog ]]; then + if check_for_gh_release "adventurelog" "seanmorley15/adventurelog"; then msg_info "Stopping Services" systemctl stop adventurelog-backend systemctl stop adventurelog-frontend @@ -42,7 +40,7 @@ function update_script() { fetch_and_deploy_gh_release "adventurelog" "seanmorley15/adventurelog" PYTHON_VERSION="3.12" setup_uv - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cp /opt/adventurelog-backup/backend/server/.env /opt/adventurelog/backend/server/.env cp -r /opt/adventurelog-backup/backend/server/media /opt/adventurelog/backend/server/media cd /opt/adventurelog/backend/server @@ -54,7 +52,7 @@ function update_script() { $STD .venv/bin/python -m pip install -r requirements.txt $STD .venv/bin/python -m manage collectstatic --noinput $STD .venv/bin/python -m manage migrate - + cp /opt/adventurelog-backup/frontend/.env /opt/adventurelog/frontend/.env cd /opt/adventurelog/frontend $STD pnpm i @@ -70,10 +68,7 @@ function update_script() { msg_info "Cleaning Up" rm -rf /opt/adventurelog-backup msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/argus.sh b/ct/argus.sh index cae3fa28a3..58de85f0be 100644 --- a/ct/argus.sh +++ b/ct/argus.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.Argus 2>/dev/null)" ]] || [[ ! -f ~/.Argus ]]; then + if check_for_gh_release "argus" "release-argus/Argus"; then msg_info "Stopping service" systemctl stop argus msg_ok "Service stopped" @@ -39,11 +37,9 @@ function update_script() { msg_info "Starting service" systemctl start argus msg_ok "Service started" - - msg_ok "Updated ${APP} to ${RELEASE}" - else - msg_ok "${APP} is already up to date (${RELEASE})" + msg_ok "Updated Successfully" fi + exit } start diff --git a/ct/authelia.sh b/ct/authelia.sh index 4dbd69fa23..fbc2698fd5 100644 --- a/ct/authelia.sh +++ b/ct/authelia.sh @@ -29,8 +29,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(/usr/bin/authelia -v | awk '{print substr($3, 2, length($2)) }')" ]]; then + + if check_for_gh_release "authelia" "authelia/authelia"; then $STD apt-get update $STD apt-get -y upgrade @@ -40,14 +40,10 @@ function update_script() { $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleanup Completed" - - msg_ok "Updated $APP to ${RELEASE}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated Successfully" fi exit } - start build_container description diff --git a/ct/autobrr.sh b/ct/autobrr.sh index 35ee681a22..e2e34dc7d7 100644 --- a/ct/autobrr.sh +++ b/ct/autobrr.sh @@ -20,30 +20,26 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /root/.config/autobrr/config.toml ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /root/.config/autobrr/config.toml ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi - RELEASE=$(curl -fsSL https://api.github.com/repos/autobrr/autobrr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.autobrr 2>/dev/null)" ]] || [[ ! -f ~/.autobrr ]]; then - msg_info "Stopping ${APP} LXC" - systemctl stop autobrr - msg_ok "Stopped ${APP} LXC" + if check_for_gh_release "autobrr" "autobrr/autobrr"; then + msg_info "Stopping ${APP} LXC" + systemctl stop autobrr + msg_ok "Stopped ${APP} LXC" - fetch_and_deploy_gh_release "autobrr" "autobrr/autobrr" "prebuild" "latest" "/usr/local/bin" "autobrr_*_linux_x86_64.tar.gz" + fetch_and_deploy_gh_release "autobrr" "autobrr/autobrr" "prebuild" "latest" "/usr/local/bin" "autobrr_*_linux_x86_64.tar.gz" - msg_info "Starting ${APP} LXC" - systemctl start autobrr - msg_ok "Started ${APP} LXC" - - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + msg_info "Starting ${APP} LXC" + systemctl start autobrr + msg_ok "Started ${APP} LXC" + msg_ok "Updated Successfully" + fi exit } diff --git a/ct/babybuddy.sh b/ct/babybuddy.sh index 8f87cea852..baf1c3c0fb 100644 --- a/ct/babybuddy.sh +++ b/ct/babybuddy.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/babybuddy/babybuddy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.babybuddy 2>/dev/null)" ]] || [[ ! -f ~/.babybuddy ]]; then + if check_for_gh_release "babybuddy" "babybuddy/babybuddy"; then setup_uv msg_info "Stopping Services" @@ -44,13 +43,13 @@ function update_script() { fetch_and_deploy_gh_release "babybuddy" "babybuddy/babybuddy" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cd /opt/babybuddy mv /tmp/production.py.bak /opt/babybuddy/babybuddy/settings/production.py source .venv/bin/activate $STD uv pip install -r requirements.txt $STD python manage.py migrate - msg_ok "Updated ${APP} to v${RELEASE}" + msg_ok "Updated ${APP}" msg_info "Fixing permissions" chown -R www-data:www-data /opt/data @@ -62,14 +61,10 @@ function update_script() { systemctl start uwsgi systemctl start nginx msg_ok "Services Started" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } - start build_container description diff --git a/ct/baikal.sh b/ct/baikal.sh index 15ed2b1aa0..05a8c41c65 100644 --- a/ct/baikal.sh +++ b/ct/baikal.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/sabre-io/Baikal/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.baikal 2>/dev/null)" ]] || [[ ! -f ~/.baikal ]]; then + if check_for_gh_release "baikal" "sabre-io/Baikal"; then msg_info "Stopping Service" systemctl stop apache2 msg_ok "Stopped Service" @@ -58,8 +57,6 @@ function update_script() { rm -rf /opt/baikal-backup msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/bar-assistant.sh b/ct/bar-assistant.sh index 42d0350474..dce83b331b 100644 --- a/ct/bar-assistant.sh +++ b/ct/bar-assistant.sh @@ -29,11 +29,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE_MEILISEARCH=$(curl -fsSL https://api.github.com/repos/meilisearch/meilisearch/releases/latest | jq -r '.tag_name | sub("^v"; "")') - RELEASE_BARASSISTANT=$(curl -fsSL https://api.github.com/repos/karlomikus/bar-assistant/releases/latest | jq -r '.tag_name | sub("^v"; "")') - RELEASE_SALTRIM=$(curl -fsSL https://api.github.com/repos/karlomikus/vue-salt-rim/releases/latest | jq -r '.tag_name | sub("^v"; "")') - - if [[ "${RELEASE_BARASSISTANT}" != "$(cat ~/.bar-assistant 2>/dev/null)" ]] || [[ ! -f ~/.bar-assistant ]]; then + if check_for_gh_release "bar-assistant" "karlomikus/bar-assistant"; then msg_info "Stopping nginx" systemctl stop nginx msg_ok "Stopped nginx" @@ -45,7 +41,7 @@ function update_script() { fetch_and_deploy_gh_release "bar-assistant" "karlomikus/bar-assistant" "tarball" "latest" "/opt/bar-assistant" setup_composer - msg_info "Updating ${APP} to ${RELEASE_BARASSISTANT}" + msg_info "Updating Bar-Assistant" cp -r /opt/bar-assistant-backup/.env /opt/bar-assistant/.env cp -r /opt/bar-assistant-backup/storage/bar-assistant /opt/bar-assistant/storage/bar-assistant cd /opt/bar-assistant @@ -58,7 +54,7 @@ function update_script() { $STD php artisan route:cache $STD php artisan event:cache chown -R www-data:www-data /opt/bar-assistant - msg_ok "Updated $APP to ${RELEASE_BARASSISTANT}" + msg_ok "Updated Bar-Assistant" msg_info "Starting nginx" systemctl start nginx @@ -67,11 +63,9 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/bar-assistant-backup msg_ok "Cleaned" - else - msg_ok "No update required. ${APP} is already at ${RELEASE_BARASSISTANT}" fi - if [[ "${RELEASE_SALTRIM}" != "$(cat ~/.vue-salt-rim 2>/dev/null)" ]] || [[ ! -f ~/.vue-salt-rim ]]; then + if check_for_gh_release "vue-salt-rim" "karlomikus/vue-salt-rim"; then msg_info "Backing up Vue Salt Rim" mv /opt/vue-salt-rim /opt/vue-salt-rim-backup msg_ok "Backed up Vue Salt Rim" @@ -82,12 +76,12 @@ function update_script() { fetch_and_deploy_gh_release "vue-salt-rim" "karlomikus/vue-salt-rim" "tarball" "latest" "/opt/vue-salt-rim" - msg_info "Updating Salt Rim to ${RELEASE_SALTRIM}" + msg_info "Updating Vue Salt Rim" cp /opt/vue-salt-rim-backup/public/config.js /opt/vue-salt-rim/public/config.js cd /opt/vue-salt-rim $STD npm install $STD npm run build - msg_ok "Updated $APP to ${RELEASE_SALTRIM}" + msg_ok "Updated Vue Salt Rim" msg_info "Starting nginx" systemctl start nginx @@ -96,12 +90,9 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/vue-salt-rim-backup msg_ok "Cleaned" - msg_ok "Updated" - else - msg_ok "No update required. Salt Rim is already at ${RELEASE_SALTRIM}" fi - if [[ "${RELEASE_MEILISEARCH}" != "$(cat ~/.meilisearch 2>/dev/null)" ]] || [[ ! -f ~/.meilisearch ]]; then + if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then msg_info "Stopping Meilisearch" systemctl stop meilisearch msg_ok "Stopped Meilisearch" @@ -111,10 +102,7 @@ function update_script() { msg_info "Starting Meilisearch" systemctl start meilisearch msg_ok "Started Meilisearch" - - msg_ok "Updated Meilisearch" - else - msg_ok "No update required. Meilisearch is already at ${RELEASE_MEILISEARCH}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/barcode-buddy.sh b/ct/barcode-buddy.sh index b6c30de0de..e28491ce05 100644 --- a/ct/barcode-buddy.sh +++ b/ct/barcode-buddy.sh @@ -28,8 +28,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Forceu/barcodebuddy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.barcodebuddy 2>/dev/null)" ]] || [[ ! -f ~/.barcodebuddy ]]; then + + if check_for_gh_release "barcodebuddy" "Forceu/barcodebuddy"; then msg_info "Stopping Service" systemctl stop apache2 systemctl stop barcodebuddy @@ -55,8 +55,6 @@ function update_script() { rm -r /opt/barcodebuddy-backup msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/bazarr.sh b/ct/bazarr.sh index e22afc3b8b..4dec01d5cf 100755 --- a/ct/bazarr.sh +++ b/ct/bazarr.sh @@ -27,14 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/morpheus65535/bazarr/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.bazarr 2>/dev/null)" ]] || [[ ! -f ~/.bazarr ]]; then - + if check_for_gh_release "bazarr" "morpheus65535/bazarr"; then PYTHON_VERSION="3.13" setup_uv fetch_and_deploy_gh_release "bazarr" "morpheus65535/bazarr" "prebuild" "latest" "/opt/bazarr" "bazarr.zip" @@ -44,10 +37,7 @@ function update_script() { sed -i.bak 's/--only-binary=Pillow//g' /opt/bazarr/requirements.txt $STD uv pip install -r /opt/bazarr/requirements.txt --system msg_ok "Setup Bazarr" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/bitmagnet.sh b/ct/bitmagnet.sh index c450395df5..765e3e2781 100644 --- a/ct/bitmagnet.sh +++ b/ct/bitmagnet.sh @@ -27,8 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/bitmagnet-io/bitmagnet/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.bitmagnet 2>/dev/null)" ]] || [[ ! -f ~/.bitmagnet ]]; then + if check_for_gh_release "bitmagnet" "bitmagnet-io/bitmagnet"; then msg_info "Stopping Service" systemctl stop bitmagnet-web msg_ok "Stopped Service" @@ -63,22 +62,19 @@ function update_script() { rm -rf /opt/bitmagnet fetch_and_deploy_gh_release "bitmagnet" "bitmagnet-io/bitmagnet" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cd /opt/bitmagnet - VREL=v$RELEASE + VREL=v$(curl -fsSL https://api.github.com/repos/bitmagnet-io/bitmagnet/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') $STD go build -ldflags "-s -w -X github.com/bitmagnet-io/bitmagnet/internal/version.GitTag=$VREL" chmod +x bitmagnet [ -f "/opt/.env" ] && cp "/opt/.env" /opt/bitmagnet/ [ -f "/opt/config.yml" ] && cp "/opt/config.yml" /opt/bitmagnet/ - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting Service" systemctl start bitmagnet-web msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/booklore.sh b/ct/booklore.sh index c0d4b8540c..ce7c8e492b 100644 --- a/ct/booklore.sh +++ b/ct/booklore.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/booklore-app/BookLore/releases/latest | yq '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.booklore 2>/dev/null)" ]] || [[ ! -f ~/.booklore ]]; then + if check_for_gh_release "booklore" "booklore-app/BookLore"; then msg_info "Stopping $APP" systemctl stop booklore msg_ok "Stopped $APP" @@ -61,10 +59,7 @@ function update_script() { systemctl start booklore systemctl reload nginx msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/bookstack.sh b/ct/bookstack.sh index 2c0bdadf99..990f30b263 100644 --- a/ct/bookstack.sh +++ b/ct/bookstack.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.bookstack 2>/dev/null)" ]] || [[ ! -f ~/.bookstack ]]; then + if check_for_gh_release "bookstack" "BookStackApp/BookStack"; then msg_info "Stopping Apache2" systemctl stop apache2 msg_ok "Services Stopped" @@ -58,7 +57,6 @@ function update_script() { chmod -R 755 /opt/bookstack /opt/bookstack/bootstrap/cache /opt/bookstack/public/uploads /opt/bookstack/storage chmod -R 775 /opt/bookstack/storage /opt/bookstack/bootstrap/cache /opt/bookstack/public/uploads chmod -R 640 /opt/bookstack/.env - echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Configured BookStack" msg_info "Starting Apache2" @@ -69,12 +67,9 @@ function update_script() { rm -rf /opt/bookstack-backup msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } - start build_container description diff --git a/ct/bytestash.sh b/ct/bytestash.sh index bac7f28fcd..55aebf29ab 100644 --- a/ct/bytestash.sh +++ b/ct/bytestash.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/jordan-dalby/ByteStash/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.bytestash 2>/dev/null)" ]] || [[ ! -f ~/.bytestash ]]; then - + if check_for_gh_release "bytestash" "jordan-dalby/ByteStash"; then read -rp "${TAB3}Did you make a backup via application WebUI? (y/n): " backuped if [[ "$backuped" =~ ^[Yy]$ ]]; then msg_info "Stopping Services" @@ -57,10 +55,7 @@ function update_script() { exit fi msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi - exit } start diff --git a/ct/checkmk.sh b/ct/checkmk.sh index 6b9ddd4392..40ff1c9377 100644 --- a/ct/checkmk.sh +++ b/ct/checkmk.sh @@ -27,23 +27,21 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | tr ' ' '\n' | grep -Ev 'rc|b' | sort -V | tail -n 1) - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + if check_for_gh_release "checkmk" "checkmk/checkmk"; then + RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | tr ' ' '\n' | grep -Ev 'rc|b' | sort -V | tail -n 1) msg_info "Updating ${APP} to v${RELEASE}" $STD omd stop monitoring $STD omd cp monitoring monitoringbackup -curl -fsSL "https://download.checkmk.com/checkmk/${RELEASE}/check-mk-raw-${RELEASE}_0.bookworm_amd64.deb" -o "/opt/checkmk.deb" + curl -fsSL "https://download.checkmk.com/checkmk/${RELEASE}/check-mk-raw-${RELEASE}_0.bookworm_amd64.deb" -o "/opt/checkmk.deb" $STD apt-get install -y /opt/checkmk.deb $STD omd --force -V ${RELEASE}.cre update --conflict=install monitoring $STD omd start monitoring $STD omd -f rm monitoringbackup $STD omd cleanup rm -rf /opt/checkmk.deb - msg_ok "Updated ${APP} to v${RELEASE}" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." + msg_ok "Updated ${APP}" + msg_ok "Updated Successfully" fi - exit } diff --git a/ct/cleanuparr.sh b/ct/cleanuparr.sh index 5039329d80..4bc0f82dab 100755 --- a/ct/cleanuparr.sh +++ b/ct/cleanuparr.sh @@ -20,32 +20,27 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /opt/cleanuparr/Cleanuparr ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.Cleanuparr 2>/dev/null)" ]] || [[ ! -f ~/.Cleanuparr ]]; then - msg_info "Stopping ${APP}" - systemctl stop cleanuparr - msg_ok "Stopped ${APP}" - - fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "latest" "/opt/cleanuparr" "*linux-amd64.zip" - - msg_info "Starting ${APP}" - systemctl start cleanuparr - msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /opt/cleanuparr/Cleanuparr ]]; then + msg_error "No ${APP} Installation Found!" exit -} + fi + if check_for_gh_release "cleanuparr" "Cleanuparr/Cleanuparr"; then + msg_info "Stopping ${APP}" + systemctl stop cleanuparr + msg_ok "Stopped ${APP}" + fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "latest" "/opt/cleanuparr" "*linux-amd64.zip" + + msg_info "Starting ${APP}" + systemctl start cleanuparr + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + fi + exit +} start build_container description diff --git a/ct/cloudreve.sh b/ct/cloudreve.sh index 516422b951..c8e76287f5 100644 --- a/ct/cloudreve.sh +++ b/ct/cloudreve.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/cloudreve/cloudreve/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.cloudreve 2>/dev/null)" ]] || [[ ! -f ~/.cloudreve ]]; then + if check_for_gh_release "cloudreve" "cloudreve/cloudreve"; then msg_info "Stopping $APP" systemctl stop cloudreve msg_ok "Stopped $APP" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting $APP" systemctl start cloudreve msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/commafeed.sh b/ct/commafeed.sh index 9ae4a090b9..6c7809e242 100644 --- a/ct/commafeed.sh +++ b/ct/commafeed.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Athou/commafeed/releases/latest | grep '"tag_name":' | cut -d'"' -f4) - if [[ "${RELEASE}" != "$(cat ~/.commafeed 2>/dev/null)" ]] || [[ ! -f ~/.commafeed ]]; then + if check_for_gh_release "commafeed" "Athou/commafeed"; then msg_info "Stopping ${APP}" systemctl stop commafeed msg_ok "Stopped ${APP}" @@ -59,8 +58,6 @@ function update_script() { systemctl start commafeed msg_ok "Started ${APP}" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/configarr.sh b/ct/configarr.sh index c6268d07af..a8d56a7c53 100644 --- a/ct/configarr.sh +++ b/ct/configarr.sh @@ -27,13 +27,12 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/raydak-labs/configarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.configarr 2>/dev/null || cat /opt/configarr_version.txt 2>/dev/null)" ]]; then + if check_for_gh_release "configarr" "raydak-labs/configarr"; then msg_info "Stopping $APP" systemctl stop configarr-task.timer msg_ok "Stopped $APP" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" mkdir -p /opt/backup/ mv /opt/configarr/{config.yml,secrets.yml,.env} "/opt/backup/" rm -rf /opt/configarr @@ -42,16 +41,14 @@ function update_script() { cd /opt/configarr $STD pnpm install $STD pnpm run build - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start configarr-task.timer msg_ok "Started configarr" rm -rf /opt/backup - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/convertx.sh b/ct/convertx.sh index 8c0c15ff14..1bfbae6459 100644 --- a/ct/convertx.sh +++ b/ct/convertx.sh @@ -27,8 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/C4illin/ConvertX/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.convertx 2>/dev/null)" ]] || [[ ! -f ~/.convertx ]]; then + if check_for_gh_release "ConvertX" "C4illin/ConvertX"; then msg_info "Stopping $APP" systemctl stop convertx msg_ok "Stopped $APP" @@ -41,25 +40,21 @@ function update_script() { fetch_and_deploy_gh_release "ConvertX" "C4illin/ConvertX" "tarball" "latest" "/opt/convertx" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" if [[ -d /opt/data ]]; then mv /opt/data /opt/convertx/data fi cd /opt/convertx $STD bun install - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start convertx msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } - start build_container description diff --git a/ct/cronicle.sh b/ct/cronicle.sh index 5dc536c38e..1e10d1ad3c 100644 --- a/ct/cronicle.sh +++ b/ct/cronicle.sh @@ -33,52 +33,42 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then - if ! command -v npm >/dev/null 2>&1; then - echo "Installing NPM..." - $STD apt-get install -y npm - echo "Installed NPM..." - fi - fi + NODE_VERSION="22" setup_nodejs + msg_info "Updating ${APP}" $STD /opt/cronicle/bin/control.sh upgrade msg_ok "Updated ${APP}" exit fi if [ "$UPD" == "2" ]; then - if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then - if ! command -v npm >/dev/null 2>&1; then - echo "Installing NPM..." - $STD apt-get install -y npm - echo "Installed NPM..." - fi - fi - LATEST=$(curl -fsSL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) - IP=$(hostname -I | awk '{print $1}') - msg_info "Installing Dependencies" - $STD apt-get install -y \ - git \ - build-essential \ - ca-certificates \ - gnupg2 - msg_ok "Installed Dependencies" - NODE_VERSION="22" setup_nodejs - fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle" + if check_for_gh_release "cronicle" "jhuckaby/Cronicle"; then + IP=$(hostname -I | awk '{print $1}') + msg_info "Installing Dependencies" + $STD apt-get install -y \ + git \ + build-essential \ + ca-certificates \ + gnupg2 + msg_ok "Installed Dependencies" - msg_info "Configuring Cronicle Worker" - cd /opt/cronicle - $STD npm install - $STD node bin/build.js dist - sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json - $STD /opt/cronicle/bin/control.sh start - $STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled - chmod 775 /etc/init.d/cronicled - $STD update-rc.d cronicled defaults - msg_ok "Installed Cronicle Worker" - - echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n" - exit + NODE_VERSION="22" setup_nodejs + fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle" + + msg_info "Configuring Cronicle Worker" + cd /opt/cronicle + $STD npm install + $STD node bin/build.js dist + sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json + $STD /opt/cronicle/bin/control.sh start + $STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled + chmod 775 /etc/init.d/cronicled + $STD update-rc.d cronicled defaults + msg_ok "Installed Cronicle Worker" + + echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n" + exit + fi fi } diff --git a/ct/cryptpad.sh b/ct/cryptpad.sh index 466af1c0c4..80c7416781 100644 --- a/ct/cryptpad.sh +++ b/ct/cryptpad.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/cryptpad/cryptpad/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.cryptpad 2>/dev/null)" ]] || [[ ! -f ~/.cryptpad ]]; then + if check_for_gh_release "cryptpad" "cryptpad/cryptpad"; then msg_info "Stopping $APP" systemctl stop cryptpad msg_ok "Stopped $APP" @@ -40,12 +39,12 @@ function update_script() { fetch_and_deploy_gh_release "cryptpad" "cryptpad/cryptpad" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" cd /opt/cryptpad $STD npm ci $STD npm run install:components $STD npm run build - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Restoring configuration" mv /opt/config.js /opt/cryptpad/config/ @@ -54,10 +53,7 @@ function update_script() { msg_info "Starting $APP" systemctl start cryptpad msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/dashy.sh b/ct/dashy.sh index 2bd30a1f00..39d2285e9f 100644 --- a/ct/dashy.sh +++ b/ct/dashy.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Lissy93/dashy/releases/latest | grep '"tag_name":' | cut -d'"' -f4) - if [[ "${RELEASE}" != "$(cat ~/.dashy 2>/dev/null)" ]] || [[ ! -f ~/.dashy ]]; then + if check_for_gh_release "dashy" "Lissy93/dashy"; then msg_info "Stopping ${APP}" systemctl stop dashy msg_ok "Stopped ${APP}" @@ -46,11 +44,11 @@ function update_script() { rm -rf /opt/dashy fetch_and_deploy_gh_release "dashy" "Lissy93/dashy" - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" cd /opt/dashy npm install npm run build - msg_ok "Updated ${APP} to ${RELEASE}" + msg_ok "Updated ${APP}" msg_info "Restoring conf.yml" cd ~ @@ -64,10 +62,7 @@ function update_script() { msg_info "Starting Dashy" systemctl start dashy msg_ok "Started Dashy" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/docmost.sh b/ct/docmost.sh index edb21b0ae0..58d9823f5c 100644 --- a/ct/docmost.sh +++ b/ct/docmost.sh @@ -30,8 +30,8 @@ function update_script() { NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs fi export NODE_OPTIONS="--max_old_space_size=4096" - RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.docmost 2>/dev/null)" ]] || [[ ! -f ~/.docmost ]]; then + + if check_for_gh_release "docmost" "docmost/docmost"; then msg_info "Stopping ${APP}" systemctl stop docmost msg_ok "${APP} Stopped" @@ -44,7 +44,7 @@ function update_script() { fetch_and_deploy_gh_release "docmost" "docmost/docmost" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cd /opt/docmost mv /opt/.env /opt/docmost/.env mv /opt/data /opt/docmost/data @@ -55,10 +55,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start docmost msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/duplicati.sh b/ct/duplicati.sh index 2abdde930c..ed0baf69a8 100644 --- a/ct/duplicati.sh +++ b/ct/duplicati.sh @@ -20,31 +20,27 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /usr/bin/duplicati-server ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/duplicati/duplicati/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') - if [[ "${RELEASE}" != "$(cat ~/.duplicati)" ]] || [[ ! -f ~/.duplicati ]]; then - msg_info "Stopping $APP" - systemctl stop duplicati - msg_ok "Stopped $APP" - - fetch_and_deploy_gh_release "duplicati" "duplicati/duplicati" "binary" "latest" "/opt/duplicati" "duplicati-*-linux-x64-gui.deb" - - msg_info "Starting $APP" - systemctl start duplicati - msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /usr/bin/duplicati-server ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "duplicati" "duplicati/duplicati"; then + msg_info "Stopping $APP" + systemctl stop duplicati + msg_ok "Stopped $APP" + + fetch_and_deploy_gh_release "duplicati" "duplicati/duplicati" "binary" "latest" "/opt/duplicati" "duplicati-*-linux-x64-gui.deb" + + msg_info "Starting $APP" + systemctl start duplicati + msg_ok "Started $APP" + msg_ok "Update Successful" + fi + exit } start diff --git a/ct/emby.sh b/ct/emby.sh index 166c042694..bb3bd5c5bf 100644 --- a/ct/emby.sh +++ b/ct/emby.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4) - if [[ "${RELEASE}" != "$(cat ~/.emby 2>/dev/null)" ]] || [[ ! -f ~/.emby ]]; then + if check_for_gh_release "emby" "MediaBrowser/Emby.Releases"; then msg_info "Stopping ${APP}" systemctl stop emby-server msg_ok "Stopped ${APP}" @@ -39,10 +38,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start emby-server msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/ersatztv.sh b/ct/ersatztv.sh index 8c2ff5d331..7ccd2fb35e 100644 --- a/ct/ersatztv.sh +++ b/ct/ersatztv.sh @@ -26,10 +26,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\Kv\K[^"]+' | head -n1) - RELEASE_FFMPEG=$(curl -fsSL https://api.github.com/repos/ErsatzTV/ErsatzTV-ffmpeg/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) - - if [[ "${RELEASE}" != "$(cat ~/.ersatztv 2>/dev/null)" ]] || [[ ! -f ~/.ersatztv ]]; then + if check_for_gh_release "ersatztv" "ErsatzTV/ErsatzTV"; then msg_info "Stopping ErsatzTV" systemctl stop ersatzTV msg_ok "Stopped ErsatzTV" @@ -41,11 +38,9 @@ function update_script() { msg_ok "Started ErsatzTV" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi - if [[ "${RELEASE_FFMPEG}" != "$(cat ~/.ersatztv-ffmpeg 2>/dev/null)" ]] || [[ ! -f ~/.ersatztv-ffmpeg ]]; then + if check_for_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg"; then msg_info "Stopping ErsatzTV" systemctl stop ersatzTV msg_ok "Stopped ErsatzTV" @@ -62,10 +57,7 @@ function update_script() { msg_info "Starting ErsatzTV" systemctl start ersatzTV msg_ok "Started ErsatzTV" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ErsatzTV-ffmpeg is already at ${RELEASE_FFMPEG}" fi exit } diff --git a/ct/excalidraw.sh b/ct/excalidraw.sh index b93b62377b..44ac37ac93 100644 --- a/ct/excalidraw.sh +++ b/ct/excalidraw.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/excalidraw/excalidraw/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.excalidraw 2>/dev/null)" ]] || [[ ! -f ~/.excalidraw ]]; then + if check_for_gh_release "excalidraw" "excalidraw/excalidraw"; then msg_info "Stopping $APP" systemctl stop excalidraw msg_ok "Stopped $APP" @@ -37,18 +36,15 @@ function update_script() { rm -rf /opt/excalidraw fetch_and_deploy_gh_release "excalidraw" "excalidraw/excalidraw" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" cd /opt/excalidraw $STD yarn - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start excalidraw msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/firefly.sh b/ct/firefly.sh index f6a3a42314..acfb29fccf 100644 --- a/ct/firefly.sh +++ b/ct/firefly.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') - if [[ "${RELEASE}" != "$(cat ~/.firefly 2>/dev/null)" ]] || [[ ! -f ~/.firefly ]]; then + if check_for_gh_release "firefly" "firefly-iii/firefly-iii"; then msg_info "Stopping Apache2" systemctl stop apache2 msg_ok "Stopped Apache2" @@ -42,11 +41,11 @@ function update_script() { fetch_and_deploy_gh_release "firefly" "firefly-iii/firefly-iii" "prebuild" "latest" "/opt/firefly" "FireflyIII-*.zip" setup_composer - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" rm -rf /opt/firefly/storage cp /opt/.env /opt/firefly/.env cp -r /opt/storage /opt/firefly/storage - + chown -R www-data:www-data /opt/firefly find /opt/firefly/storage -type d -exec chmod 775 {} \; find /opt/firefly/storage -type f -exec chmod 664 {} \; @@ -58,15 +57,12 @@ function update_script() { $STD php artisan view:clear $STD php artisan firefly-iii:upgrade-database $STD php artisan firefly-iii:laravel-passport-keys - msg_ok "Updated ${APP} to v${RELEASE}" + msg_ok "Updated ${APP}" msg_info "Starting Apache2" systemctl start apache2 msg_ok "Started Apache2" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/flaresolverr.sh b/ct/flaresolverr.sh index 0a2a1f2dcd..321313d2b9 100644 --- a/ct/flaresolverr.sh +++ b/ct/flaresolverr.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/FlareSolverr/FlareSolverr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') - if [[ "${RELEASE}" != "$(cat ~/.flaresolverr 2>/dev/null)" ]] || [[ ! -f ~/.flaresolverr ]]; then + if check_for_gh_release "flaresolverr" "FlareSolverr/FlareSolverr" "3.3.5"; then msg_info "Stopping service" systemctl stop flaresolverr msg_ok "Stopped service" @@ -40,8 +39,6 @@ function update_script() { msg_info "Starting service" systemctl start flaresolverr msg_ok "Started service" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/fluid-calendar.sh b/ct/fluid-calendar.sh index f9b53474cd..42f4c3c83a 100644 --- a/ct/fluid-calendar.sh +++ b/ct/fluid-calendar.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.fluid-calendar 2>/dev/null)" ]] || [[ ! -f ~/.fluid-calendar ]]; then + if check_for_gh_release "fluid-calendar" "dotnetfactory/fluid-calendar"; then msg_info "Stopping $APP" systemctl stop fluid-calendar msg_ok "Stopped $APP" @@ -38,7 +37,7 @@ function update_script() { rm -rf /opt/fluid-calendar fetch_and_deploy_gh_release "fluid-calendar" "dotnetfactory/fluid-calendar" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" mv /opt/fluid.env /opt/fluid-calendar/.env cd /opt/fluid-calendar export NEXT_TELEMETRY_DISABLED=1 @@ -46,15 +45,12 @@ function update_script() { $STD npm run prisma:generate $STD npx prisma migrate deploy $STD npm run build:os - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start fluid-calendar msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/gatus.sh b/ct/gatus.sh index b4c85b3bb5..a3f0112e29 100644 --- a/ct/gatus.sh +++ b/ct/gatus.sh @@ -28,10 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -s https://api.github.com/repos/TwiN/gatus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.gatus 2>/dev/null)" ]] || [[ ! -f ~/.gatus ]]; then - msg_info "Updating $APP" - + if check_for_gh_release "gatus" "TwiN/gatus"; then msg_info "Stopping $APP" systemctl stop gatus msg_ok "Stopped $APP" @@ -40,21 +37,18 @@ function update_script() { rm -rf /opt/gatus fetch_and_deploy_gh_release "gatus" "TwiN/gatus" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" cd /opt/gatus $STD go mod tidy CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus . setcap CAP_NET_RAW+ep gatus mv /opt/config.yaml config - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start gatus msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/gitea-mirror.sh b/ct/gitea-mirror.sh index 7459895e8c..f4fcd65430 100644 --- a/ct/gitea-mirror.sh +++ b/ct/gitea-mirror.sh @@ -32,25 +32,21 @@ function update_script() { APP_VERSION=$(grep -o '"version": *"[^"]*"' /opt/gitea-mirror/package.json | cut -d'"' -f4) if [[ $APP_VERSION =~ ^2\. ]]; then if ! whiptail --backtitle "Gitea Mirror Update" --title "⚠️ VERSION 2.x DETECTED" --yesno \ - "WARNING: Version $APP_VERSION detected!\n\nUpdating from version 2.x will CLEAR ALL CONFIGURATION.\n\nThis includes:\n• API tokens\n• User settings\n• Repository configurations\n• All custom settings\n\nDo you want to continue with the update process?" 15 70 --defaultno - then + "WARNING: Version $APP_VERSION detected!\n\nUpdating from version 2.x will CLEAR ALL CONFIGURATION.\n\nThis includes:\n• API tokens\n• User settings\n• Repository configurations\n• All custom settings\n\nDo you want to continue with the update process?" 15 70 --defaultno; then exit 0 fi if ! whiptail --backtitle "Gitea Mirror Update" --title "⚠️ FINAL CONFIRMATION" --yesno \ - "FINAL WARNING: This update WILL clear all configuration!\n\nBEFORE PROCEEDING, please:\n\n• Copy API tokens to a safe location\n• Backup any custom configurations\n• Note down repository settings\n\nThis action CANNOT be undone!" 18 70 --defaultno - then - whiptail --backtitle "Gitea Mirror Update" --title "Update Cancelled" --msgbox "Update process cancelled. Please backup your configuration before proceeding." 8 60 - exit 0 + "FINAL WARNING: This update WILL clear all configuration!\n\nBEFORE PROCEEDING, please:\n\n• Copy API tokens to a safe location\n• Backup any custom configurations\n• Note down repository settings\n\nThis action CANNOT be undone!" 18 70 --defaultno; then + whiptail --backtitle "Gitea Mirror Update" --title "Update Cancelled" --msgbox "Update process cancelled. Please backup your configuration before proceeding." 8 60 + exit 0 fi whiptail --backtitle "Gitea Mirror Update" --title "Proceeding with Update" --msgbox \ - "Proceeding with version $APP_VERSION update.\n\nAll configuration will be cleared as warned." 8 50 + "Proceeding with version $APP_VERSION update.\n\nAll configuration will be cleared as warned." 8 50 rm -rf /opt/gitea-mirror fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/RayLabsHQ/gitea-mirror/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.${APP} 2>/dev/null || cat /opt/${APP}_version.txt 2>/dev/null)" ]]; then + if check_for_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"; then msg_info "Stopping Services" systemctl stop gitea-mirror msg_ok "Services Stopped" @@ -70,25 +66,23 @@ function update_script() { rm -rf /opt/gitea-mirror fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror" - msg_info "Updating and rebuilding ${APP} to v${RELEASE}" + msg_info "Updating and rebuilding ${APP}" cd /opt/gitea-mirror $STD bun run setup $STD bun run build APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4) sudo sed -i.bak "s|^Environment=npm_package_version=.*|Environment=npm_package_version=${APP_VERSION}|" /etc/systemd/system/gitea-mirror.service - msg_ok "Updated and rebuilt ${APP} to v${RELEASE}" + msg_ok "Updated and rebuilt ${APP}" msg_info "Restoring Data" cp /opt/gitea-mirror-backup/data/* /opt/gitea-mirror/data - echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Restored Data" msg_info "Starting Service" systemctl daemon-reload systemctl start gitea-mirror msg_ok "Service Started" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Update Successfully" fi exit } diff --git a/ct/gitea.sh b/ct/gitea.sh index f5a7119a3e..e7d2acbc0b 100644 --- a/ct/gitea.sh +++ b/ct/gitea.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://github.com/go-gitea/gitea/releases/latest | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.gitea 2>/dev/null)" ]] || [[ ! -f ~/.gitea ]]; then + if check_for_gh_release "gitea" "go-gitea/gitea"; then msg_info "Stopping service" systemctl stop gitea msg_ok "Service stopped" @@ -41,10 +40,7 @@ function update_script() { msg_info "Starting service" systemctl start gitea msg_ok "Started service" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/glance.sh b/ct/glance.sh index 41bb6f5a6c..8f2f582bb1 100644 --- a/ct/glance.sh +++ b/ct/glance.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/glanceapp/glance/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.glance 2>/dev/null)" ]] || [[ ! -f ~/.glance ]]; then + if check_for_gh_release "glance" "glanceapp/glance"; then msg_info "Stopping Service" systemctl stop glance msg_ok "Stopped Service" @@ -40,10 +39,7 @@ function update_script() { msg_info "Starting Service" systemctl start glance msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/go2rtc.sh b/ct/go2rtc.sh index e57d5d8fb2..fbc9b26068 100644 --- a/ct/go2rtc.sh +++ b/ct/go2rtc.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/AlexxIT/go2rtc/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.go2rtc 2>/dev/null)" ]] || [[ ! -f ~/.go2rtc ]]; then + if check_for_gh_release "go2rtc" "AlexxIT/go2rtc"; then msg_info "Stopping service" systemctl stop go2rtc msg_ok "Stopped service" @@ -39,10 +38,7 @@ function update_script() { msg_info "Starting service" systemctl start go2rtc msg_ok "Started service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/gokapi.sh b/ct/gokapi.sh index be5779b385..0c51cc0191 100644 --- a/ct/gokapi.sh +++ b/ct/gokapi.sh @@ -20,19 +20,14 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/gokapi ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - if [[ -f /opt/${APP}_version.txt ]]; then - mv /opt/${APP}_version ~/.gokapi - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Forceu/Gokapi/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.gokapi 2>/dev/null)" ]] || [[ ! -f ~/.gokapi ]]; then + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/gokapi ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + if check_for_gh_release "gokapi" "Forceu/Gokapi"; then msg_info "Stopping ${APP}" systemctl stop gokapi msg_ok "Stopped ${APP}" @@ -42,10 +37,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start gokapi msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/gomft.sh b/ct/gomft.sh index 3e46eda3c1..e9a6e6344e 100644 --- a/ct/gomft.sh +++ b/ct/gomft.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL "https://api.github.com/repos/StarFleetCPTN/GoMFT/releases/latest" | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.gomft)" ]] || [[ ! -f ~/.gomft ]]; then + if check_for_gh_release "gomft" "StarFleetCPTN/GoMFT"; then msg_info "Stopping $APP" systemctl stop gomft msg_ok "Stopped $APP" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting $APP" systemctl start gomft msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/gotify.sh b/ct/gotify.sh index 1811d84ef2..a168379348 100644 --- a/ct/gotify.sh +++ b/ct/gotify.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/gotify/server/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.gotify 2>/dev/null)" ]] || [[ ! -f ~/.gotify ]]; then + if check_for_gh_release "gotify" "gotify/server"; then msg_info "Stopping ${APP}" systemctl stop gotify msg_ok "Stopped ${APP}" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start gotify msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/grocy.sh b/ct/grocy.sh index 38e1893247..3976933903 100644 --- a/ct/grocy.sh +++ b/ct/grocy.sh @@ -27,19 +27,14 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - php_ver=$(php -v | head -n 1 | awk '{print $2}') if [[ ! $php_ver == "8.3"* ]]; then PHP_VERSION="8.3" PHP_MODULE="sqlite3,bz2" PHP_APACHE="yes" setup_php fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/grocy/grocy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.grocy 2>/dev/null)" ]] || [[ ! -f ~/.grocy ]]; then + if check_for_gh_release "grocy" "grocy/grocy"; then msg_info "Updating ${APP}" bash /var/www/html/update.sh msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/habitica.sh b/ct/habitica.sh index 75c64648ce..499b8a9011 100644 --- a/ct/habitica.sh +++ b/ct/habitica.sh @@ -29,9 +29,7 @@ function update_script() { exit fi NODE_VERSION="20" NODE_MODULE="gulp-cli,mocha" setup_nodejs - RELEASE=$(curl -fsSL https://api.github.com/repos/HabitRPG/habitica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.habitica 2>/dev/null)" ]] || [[ ! -f ~/.habitica ]]; then - + if check_for_gh_release "habitica" "HabitRPG/habitica"; then msg_info "Stopping $APP" systemctl stop habitica-mongodb systemctl stop habitica @@ -48,13 +46,13 @@ function update_script() { fetch_and_deploy_gh_release "habitica" "HabitRPG/habitica" "tarball" "latest" "/opt/habitica" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" cd /opt/habitica $STD npm i $STD npm run postinstall $STD npm run client:build $STD gulp build:prod - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Restoring configuration" if [[ -f ~/config.json ]]; then @@ -69,10 +67,7 @@ function update_script() { systemctl start habitica systemctl start habitica-client msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/headscale.sh b/ct/headscale.sh index 4e802836f1..4dd3de7f25 100644 --- a/ct/headscale.sh +++ b/ct/headscale.sh @@ -31,8 +31,7 @@ function update_script() { mv /opt/"${APP}_version.txt" ~/.headscale fi - RELEASE=$(curl -fsSL https://api.github.com/repos/juanfont/headscale/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.headscale 2>/dev/null)" ]] || [[ ! -f ~/.headscale ]]; then + if check_for_gh_release "headscale" "juanfont/headscale"; then msg_info "Stopping ${APP}" systemctl stop headscale msg_ok "Stopped ${APP}" @@ -41,12 +40,9 @@ function update_script() { fetch_and_deploy_gh_release "headscale-admin" "GoodiesHQ/headscale-admin" "prebuild" "latest" "/opt/headscale-admin" "admin.zip" msg_info "Starting ${APP}" - # Temporary fix until headscale project resolves service getting disabled on updates. systemctl enable -q --now headscale msg_ok "Started ${APP}" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/healthchecks.sh b/ct/healthchecks.sh index 2814c41c57..373cc6eae0 100644 --- a/ct/healthchecks.sh +++ b/ct/healthchecks.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/healthchecks/healthchecks/releases/latest | jq '.tag_name' | sed 's/^"v//;s/"$//') - if [[ "${RELEASE}" != "$(cat ~/.healthchecks 2>/dev/null)" ]] || [[ ! -f ~/.healthchecks ]]; then + if check_for_gh_release "healthchecks" "healthchecks/healthchecks"; then msg_info "Stopping $APP" systemctl stop healthchecks msg_ok "Stopped $APP" @@ -38,7 +36,7 @@ function update_script() { setup_uv fetch_and_deploy_gh_release "healthchecks" "healthchecks/healthchecks" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" cd /opt/healthchecks mkdir -p /opt/healthchecks/static-collected/ $STD uv pip install wheel gunicorn -r requirements.txt --system @@ -46,16 +44,13 @@ function update_script() { $STD uv run -- python manage.py migrate --noinput $STD uv run -- python manage.py collectstatic --noinput $STD uv run -- python manage.py compress - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start healthchecks systemctl restart caddy msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/homarr.sh b/ct/homarr.sh index e50ba4e6e6..55b5b1583f 100644 --- a/ct/homarr.sh +++ b/ct/homarr.sh @@ -81,9 +81,8 @@ EOF msg_ok "Updated Services" systemctl daemon-reload fi - RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.${APP} 2>/dev/null || cat /opt/${APP}_version.txt 2>/dev/null)" ]]; then + if check_for_gh_release "homarr" "homarr-labs/homarr"; then msg_info "Stopping Services (Patience)" systemctl stop homarr msg_ok "Services Stopped" @@ -98,7 +97,6 @@ EOF $STD apt upgrade nodejs -y msg_ok "Updated Nodejs" - $STD command -v jq || $STD apt-get update && $STD apt-get install -y jq NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]') NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs @@ -106,7 +104,7 @@ EOF rm -rf /opt/homarr fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" - msg_info "Updating and rebuilding ${APP} to v${RELEASE} (Patience)" + msg_info "Updating and rebuilding ${APP} (Patience)" rm /opt/run_homarr.sh cat <<'EOF' >/opt/run_homarr.sh #!/bin/bash @@ -153,7 +151,6 @@ EOF mkdir /opt/homarr/build cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node - echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP}" msg_info "Starting Services" @@ -164,8 +161,6 @@ EOF if [[ "$choice" =~ ^[Yy]$ ]]; then reboot fi - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/homebox.sh b/ct/homebox.sh index fd2973fc77..ef421a0738 100644 --- a/ct/homebox.sh +++ b/ct/homebox.sh @@ -33,8 +33,7 @@ function update_script() { systemctl daemon-reload fi - RELEASE=$(curl -fsSL https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.homebox 2>/dev/null)" ]] || [[ ! -f ~/.homebox ]]; then + if check_for_gh_release "sysadminsmedia" "homebox"; then msg_info "Stopping ${APP}" systemctl stop homebox msg_ok "${APP} Stopped" @@ -50,10 +49,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start homebox msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/hortusfox.sh b/ct/hortusfox.sh index 716f3bb29d..a9f458ddb5 100644 --- a/ct/hortusfox.sh +++ b/ct/hortusfox.sh @@ -27,8 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/danielbrendel/hortusfox-web/releases/latest | jq -r .tag_name | sed 's/^v//') - if [[ ! -f ~/.hortusfox ]] || [[ "${RELEASE}" != "$(cat ~/.hortusfox)" ]]; then + if check_for_gh_release "danielbrendel" "hortusfox-web"; then msg_info "Stopping Service" systemctl stop apache2 msg_ok "Stopped Service" @@ -58,8 +57,6 @@ function update_script() { rm -r /opt/hortusfox-backup msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/huntarr.sh b/ct/huntarr.sh index 7e290f8977..cad58861f9 100644 --- a/ct/huntarr.sh +++ b/ct/huntarr.sh @@ -30,26 +30,24 @@ function update_script() { fi setup_uv - RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') - if [[ -f ~/.huntarr && "${RELEASE}" == "$(cat ~/.huntarr)" ]]; then - msg_ok "No update required. ${APP} is already at ${RELEASE}" - exit + + if check_for_gh_release "huntarr" "plexguide/Huntarr.io"; then + msg_info "Stopping huntarr" + systemctl stop huntarr + msg_ok "Stopped huntarr" + + fetch_and_deploy_gh_release "huntarr" "plexguide/Huntarr.io" + + msg_info "Configuring $APP" + cd /opt/huntarr + $STD uv pip install -r requirements.txt --python /opt/huntarr/.venv/bin/python + msg_ok "Configured $APP" + + msg_info "Starting $APP" + systemctl start huntarr + msg_ok "Started $APP" + msg_ok "Updated $APP" fi - msg_info "Stopping huntarr service" - systemctl stop huntarr - msg_ok "Stopped huntarr service" - - fetch_and_deploy_gh_release "huntarr" "plexguide/Huntarr.io" - msg_info "Configuring $APP" - cd /opt/huntarr - $STD uv pip install -r requirements.txt --python /opt/huntarr/.venv/bin/python - msg_ok "Configured $APP" - - msg_info "Starting $APP" - systemctl start huntarr - msg_ok "Started $APP" - - msg_ok "Updated $APP to v${RELEASE}" exit } diff --git a/ct/immich.sh b/ct/immich.sh index e759ba3e8e..5d8ac56f48 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -62,52 +62,48 @@ function update_script() { msg_ok "Image-processing libraries up to date" fi RELEASE="1.139.4" - #RELEASE=$(curl -fsSL https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ -f ~/.immich && "$RELEASE" == "$(cat ~/.immich)" ]]; then - msg_ok "No update required. ${APP} is already at v${RELEASE}" - exit - fi - msg_info "Stopping ${APP} services" - systemctl stop immich-web - systemctl stop immich-ml - msg_ok "Stopped ${APP}" - INSTALL_DIR="/opt/${APP}" - UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)" - SRC_DIR="${INSTALL_DIR}/source" - APP_DIR="${INSTALL_DIR}/app" - ML_DIR="${APP_DIR}/machine-learning" - GEO_DIR="${INSTALL_DIR}/geodata" - VCHORD_RELEASE="0.4.3" - # VCHORD_RELEASE="$(curl -fsSL https://api.github.com/repos/tensorchord/vectorchord/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')" + if check_for_gh_release "immich" "immich-app/immich" "${RELEASE}"; then + msg_info "Stopping Services" + systemctl stop immich-web + systemctl stop immich-ml + msg_ok "Stopped ${APP}" + INSTALL_DIR="/opt/${APP}" + UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)" + SRC_DIR="${INSTALL_DIR}/source" + APP_DIR="${INSTALL_DIR}/app" + ML_DIR="${APP_DIR}/machine-learning" + GEO_DIR="${INSTALL_DIR}/geodata" + VCHORD_RELEASE="0.4.3" + # VCHORD_RELEASE="$(curl -fsSL https://api.github.com/repos/tensorchord/vectorchord/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')" - if [[ ! -f ~/.vchord_version ]] || [[ "$VCHORD_RELEASE" != "$(cat ~/.vchord_version)" ]]; then - msg_info "Updating VectorChord" - if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then - $STD sudo -u postgres pg_dumpall --clean --if-exists --username=postgres | gzip >/etc/postgresql/immich-db-vchord0.3.0.sql.gz - chown postgres /etc/postgresql/immich-db-vchord0.3.0.sql.gz - $STD sudo -u postgres gunzip --stdout /etc/postgresql/immich-db-vchord0.3.0.sql.gz | - sed -e "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \ - -e "/vchordrq.prewarm_dim/d" | - sudo -u postgres psql + if [[ ! -f ~/.vchord_version ]] || [[ "$VCHORD_RELEASE" != "$(cat ~/.vchord_version)" ]]; then + msg_info "Updating VectorChord" + if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then + $STD sudo -u postgres pg_dumpall --clean --if-exists --username=postgres | gzip >/etc/postgresql/immich-db-vchord0.3.0.sql.gz + chown postgres /etc/postgresql/immich-db-vchord0.3.0.sql.gz + $STD sudo -u postgres gunzip --stdout /etc/postgresql/immich-db-vchord0.3.0.sql.gz | + sed -e "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \ + -e "/vchordrq.prewarm_dim/d" | + sudo -u postgres psql + fi + curl -fsSL "https://github.com/tensorchord/vectorchord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb + $STD apt install -y ./vchord.deb + $STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;" + systemctl restart postgresql + if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then + $STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;" + $STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;" + fi + echo "$VCHORD_RELEASE" >~/.vchord_version + rm ./vchord.deb + msg_ok "Updated VectorChord to v${VCHORD_RELEASE}" fi - curl -fsSL "https://github.com/tensorchord/vectorchord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb - $STD apt install -y ./vchord.deb - $STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;" - systemctl restart postgresql - if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then - $STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;" - $STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;" - fi - echo "$VCHORD_RELEASE" >~/.vchord_version - rm ./vchord.deb - msg_ok "Updated VectorChord to v${VCHORD_RELEASE}" - fi - cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR" - if grep -qs "set -a" "$APP_DIR"/bin/start.sh; then - cp "$APP_DIR"/bin/start.sh "$INSTALL_DIR" - else - cat <"$INSTALL_DIR"/start.sh + cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR" + if grep -qs "set -a" "$APP_DIR"/bin/start.sh; then + cp "$APP_DIR"/bin/start.sh "$INSTALL_DIR" + else + cat <"$INSTALL_DIR"/start.sh #!/usr/bin/env bash set -a @@ -116,93 +112,94 @@ set +a /usr/bin/node ${APP_DIR}/dist/main.js "\$@" EOF - chmod +x "$INSTALL_DIR"/start.sh + chmod +x "$INSTALL_DIR"/start.sh + fi + + ( + shopt -s dotglob + rm -rf "${APP_DIR:?}"/* + ) + + rm -rf "$SRC_DIR" + + fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR" + + msg_info "Updating ${APP} web and microservices" + cd "$SRC_DIR"/server + if [[ "$RELEASE" == "1.135.1" ]]; then + rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts + fi + export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 + export CI=1 + corepack enable + + # server build + export SHARP_IGNORE_GLOBAL_LIBVIPS=true + $STD pnpm --filter immich --frozen-lockfile build + unset SHARP_IGNORE_GLOBAL_LIBVIPS + export SHARP_FORCE_GLOBAL_LIBVIPS=true + $STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR" + cp "$APP_DIR"/package.json "$APP_DIR"/bin + sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin + + # openapi & web build + cd "$SRC_DIR" + $STD pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install + $STD pnpm --filter @immich/sdk --filter immich-web build + cp -a web/build "$APP_DIR"/www + cp LICENSE "$APP_DIR" + + # cli build + $STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install + $STD pnpm --filter @immich/sdk --filter @immich/cli build + $STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli + cd "$APP_DIR" + mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin + msg_ok "Updated ${APP} web and microservices" + + cd "$SRC_DIR"/machine-learning + mkdir -p "$ML_DIR" + export VIRTUAL_ENV="${ML_DIR}"/ml-venv + $STD /usr/local/bin/uv venv "$VIRTUAL_ENV" + if [[ -f ~/.openvino ]]; then + msg_info "Updating HW-accelerated machine-learning" + /usr/local/bin/uv -q sync --extra openvino --no-cache --active + patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so" + msg_ok "Updated HW-accelerated machine-learning" + else + msg_info "Updating machine-learning" + /usr/local/bin/uv -q sync --extra cpu --no-cache --active + msg_ok "Updated machine-learning" + fi + cd "$SRC_DIR" + cp -a machine-learning/{ann,immich_ml} "$ML_DIR" + mv "$INSTALL_DIR"/ml_start.sh "$ML_DIR" + if [[ -f ~/.openvino ]]; then + sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py + fi + ln -sf "$APP_DIR"/resources "$INSTALL_DIR" + cd "$APP_DIR" + grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g" + grep -rlE "'/build'" | xargs -n1 sed -i "s|'/build'|'$APP_DIR'|g" + sed -i "s@\"/cache\"@\"$INSTALL_DIR/cache\"@g" "$ML_DIR"/immich_ml/config.py + ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$APP_DIR"/upload + ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload + ln -s "$GEO_DIR" "$APP_DIR" + + chown -R immich:immich "$INSTALL_DIR" + if [[ ! -f ~/.debian_version.bak ]]; then + cp /etc/debian_version ~/.debian_version.bak + sed -i 's/.*/13.0/' /etc/debian_version + fi + msg_ok "Updated ${APP} to v${RELEASE}" + + msg_info "Cleaning up" + $STD apt-get -y autoremove + $STD apt-get -y autoclean + msg_ok "Cleaned" + systemctl restart immich-ml immich-web + exit fi - - ( - shopt -s dotglob - rm -rf "${APP_DIR:?}"/* - ) - - rm -rf "$SRC_DIR" - - fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR" - - msg_info "Updating ${APP} web and microservices" - cd "$SRC_DIR"/server - if [[ "$RELEASE" == "1.135.1" ]]; then - rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts - fi - export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 - export CI=1 - corepack enable - - # server build - export SHARP_IGNORE_GLOBAL_LIBVIPS=true - $STD pnpm --filter immich --frozen-lockfile build - unset SHARP_IGNORE_GLOBAL_LIBVIPS - export SHARP_FORCE_GLOBAL_LIBVIPS=true - $STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR" - cp "$APP_DIR"/package.json "$APP_DIR"/bin - sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin - - # openapi & web build - cd "$SRC_DIR" - $STD pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install - $STD pnpm --filter @immich/sdk --filter immich-web build - cp -a web/build "$APP_DIR"/www - cp LICENSE "$APP_DIR" - - # cli build - $STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install - $STD pnpm --filter @immich/sdk --filter @immich/cli build - $STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli - cd "$APP_DIR" - mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin - msg_ok "Updated ${APP} web and microservices" - - cd "$SRC_DIR"/machine-learning - mkdir -p "$ML_DIR" - export VIRTUAL_ENV="${ML_DIR}"/ml-venv - $STD /usr/local/bin/uv venv "$VIRTUAL_ENV" - if [[ -f ~/.openvino ]]; then - msg_info "Updating HW-accelerated machine-learning" - /usr/local/bin/uv -q sync --extra openvino --no-cache --active - patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so" - msg_ok "Updated HW-accelerated machine-learning" - else - msg_info "Updating machine-learning" - /usr/local/bin/uv -q sync --extra cpu --no-cache --active - msg_ok "Updated machine-learning" - fi - cd "$SRC_DIR" - cp -a machine-learning/{ann,immich_ml} "$ML_DIR" - mv "$INSTALL_DIR"/ml_start.sh "$ML_DIR" - if [[ -f ~/.openvino ]]; then - sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py - fi - ln -sf "$APP_DIR"/resources "$INSTALL_DIR" - cd "$APP_DIR" - grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g" - grep -rlE "'/build'" | xargs -n1 sed -i "s|'/build'|'$APP_DIR'|g" - sed -i "s@\"/cache\"@\"$INSTALL_DIR/cache\"@g" "$ML_DIR"/immich_ml/config.py - ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$APP_DIR"/upload - ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload - ln -s "$GEO_DIR" "$APP_DIR" - - chown -R immich:immich "$INSTALL_DIR" - if [[ ! -f ~/.debian_version.bak ]]; then - cp /etc/debian_version ~/.debian_version.bak - sed -i 's/.*/13.0/' /etc/debian_version - fi - msg_ok "Updated ${APP} to v${RELEASE}" - - msg_info "Cleaning up" - $STD apt-get -y autoremove - $STD apt-get -y autoclean - msg_ok "Cleaned" - systemctl restart immich-ml immich-web - exit } function compile_libjxl() { diff --git a/ct/inspircd.sh b/ct/inspircd.sh index cecc192ee2..b4a016fbfb 100644 --- a/ct/inspircd.sh +++ b/ct/inspircd.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/inspircd/inspircd/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.inspircd 2>/dev/null)" ]] || [[ ! -f ~/.inspircd ]]; then + if check_for_gh_release "inspircd" "inspircd/inspircd"; then msg_info "Stopping Service" systemctl stop inspircd msg_ok "Stopped Service" @@ -39,10 +37,7 @@ function update_script() { msg_info "Starting Service" systemctl start inspircd msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/jackett.sh b/ct/jackett.sh index 4cebe010ab..2353724d7d 100644 --- a/ct/jackett.sh +++ b/ct/jackett.sh @@ -34,13 +34,18 @@ function update_script() { DisableRootWarning=true EOF fi + if check_for_gh_release "Jackett" "Jackett/Jackett"; then + msg_info "Stopping Service" + systemctl stop jackett + msg_ok "Stopped Service" - RELEASE=$(curl -s https://api.github.com/repos/Jackett/Jackett/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.jackett 2>/dev/null)" ]] || [[ ! -f ~/.jackett ]]; then rm -rf /opt/Jackett - fetch_and_deploy_gh_release "jackett" "Jackett/Jackett" "prebuild" "latest" "/opt/Jackett" "Jackett.Binaries.LinuxAMDx64.tar.gz" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + fetch_and_deploy_gh_release "jackett" "Jackett/Jackett" "prebuild" "latest" "/opt/Jackett" "Jackett.Binaries.LinuxAMDx64.tar.gz" + + msg_info "Starting Service" + systemctl start jackett + msg_ok "Started Service" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/kapowarr.sh b/ct/kapowarr.sh index d3104fed43..b77b9c7a26 100644 --- a/ct/kapowarr.sh +++ b/ct/kapowarr.sh @@ -28,10 +28,10 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -s https://api.github.com/repos/Casvt/Kapowarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat $HOME/.kapowarr)" ]] || [[ ! -f $HOME/.kapowarr ]]; then - setup_uv - + + setup_uv + + if check_for_gh_release "kapowarr" "Casvt/Kapowarr"; then msg_info "Stopping $APP" systemctl stop kapowarr msg_ok "Stopped $APP" @@ -41,17 +41,15 @@ function update_script() { msg_ok "Backup Created" fetch_and_deploy_gh_release "kapowarr" "Casvt/Kapowarr" - msg_info "Updating $APP to ${RELEASE}" + + msg_info "Updating $APP" mv /opt/db /opt/kapowarr - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start kapowarr msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/karakeep.sh b/ct/karakeep.sh index 3bcf51080c..460c8ba1a3 100644 --- a/ct/karakeep.sh +++ b/ct/karakeep.sh @@ -28,73 +28,71 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/karakeep-app/karakeep/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ -f ~/.karakeep && "$RELEASE" == "$(cat ~/.karakeep)" ]]; then - msg_ok "No update required. ${APP} is already at ${RELEASE}" - exit + if check_for_gh_release "karakeep" "karakeep-app/karakeep"; then + msg_info "Stopping Services" + systemctl stop karakeep-web karakeep-workers karakeep-browser + msg_ok "Stopped Services" + + msg_info "Updating yt-dlp" + $STD yt-dlp --update-to nightly + msg_ok "Updated yt-dlp" + + msg_info "Prepare update" + if [[ -f /opt/${APP}_version.txt && "$(cat /opt/${APP}_version.txt)" < "0.23.0" ]]; then + $STD apt-get install -y graphicsmagick ghostscript + fi + if [[ -f /opt/karakeep/.env ]] && [[ ! -f /etc/karakeep/karakeep.env ]]; then + mkdir -p /etc/karakeep + mv /opt/karakeep/.env /etc/karakeep/karakeep.env + fi + rm -rf /opt/karakeep + msg_ok "Update prepared" + + if grep -q "start:prod" /etc/systemd/system/karakeep-workers.service; then + sed -i 's|^ExecStart=.*$|ExecStart=/usr/bin/node dist/index.mjs|' /etc/systemd/system/karakeep-workers.service + systemctl daemon-reload + fi + + fetch_and_deploy_gh_release "karakeep" "karakeep-app/karakeep" + if command -v corepack >/dev/null; then + $STD corepack disable + fi + MODULE_VERSION="$(jq -r '.packageManager | split("@")[1]' /opt/karakeep/package.json)" + NODE_VERSION="22" NODE_MODULE="pnpm@${MODULE_VERSION}" setup_nodejs + + msg_info "Updating ${APP}" + corepack enable + export PUPPETEER_SKIP_DOWNLOAD="true" + export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD="true" + export NEXT_TELEMETRY_DISABLED=1 + export CI="true" + cd /opt/karakeep/apps/web + $STD pnpm install --frozen-lockfile + $STD pnpm build + cd /opt/karakeep/apps/workers + $STD pnpm install --frozen-lockfile + $STD pnpm build + cd /opt/karakeep/apps/cli + $STD pnpm install --frozen-lockfile + $STD pnpm build + DATA_DIR="$(sed -n '/^DATA_DIR/p' /etc/karakeep/karakeep.env | awk -F= '{print $2}' | tr -d '="=')" + export DATA_DIR="${DATA_DIR:-/opt/karakeep_data}" + cd /opt/karakeep/packages/db + $STD pnpm migrate + $STD pnpm store prune + sed -i "s/^SERVER_VERSION=.*$/SERVER_VERSION=${CHECK_UPDATE_RELEASE}/" /etc/karakeep/karakeep.env + msg_ok "Updated ${APP}" + + msg_info "Starting Services" + systemctl start karakeep-browser karakeep-workers karakeep-web + msg_ok "Started Services" + + msg_info "Cleaning up" + $STD apt-get autoremove -y + $STD apt-get autoclean -y + msg_ok "Cleaned" + msg_ok "Updated Successfully" fi - msg_info "Stopping Services" - systemctl stop karakeep-web karakeep-workers karakeep-browser - msg_ok "Stopped Services" - - msg_info "Updating yt-dlp" - $STD yt-dlp --update-to nightly - msg_ok "Updated yt-dlp" - - msg_info "Prepare update" - if [[ -f /opt/${APP}_version.txt && "$(cat /opt/${APP}_version.txt)" < "0.23.0" ]]; then - $STD apt-get install -y graphicsmagick ghostscript - fi - if [[ -f /opt/karakeep/.env ]] && [[ ! -f /etc/karakeep/karakeep.env ]]; then - mkdir -p /etc/karakeep - mv /opt/karakeep/.env /etc/karakeep/karakeep.env - fi - rm -rf /opt/karakeep - msg_ok "Update prepared" - - if grep -q "start:prod" /etc/systemd/system/karakeep-workers.service; then - sed -i 's|^ExecStart=.*$|ExecStart=/usr/bin/node dist/index.mjs|' /etc/systemd/system/karakeep-workers.service - systemctl daemon-reload - fi - fetch_and_deploy_gh_release "karakeep" "karakeep-app/karakeep" - if command -v corepack >/dev/null; then - $STD corepack disable - fi - MODULE_VERSION="$(jq -r '.packageManager | split("@")[1]' /opt/karakeep/package.json)" - NODE_VERSION="22" NODE_MODULE="pnpm@${MODULE_VERSION}" setup_nodejs - - msg_info "Updating ${APP} to v${RELEASE}" - corepack enable - export PUPPETEER_SKIP_DOWNLOAD="true" - export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD="true" - export NEXT_TELEMETRY_DISABLED=1 - export CI="true" - cd /opt/karakeep/apps/web - $STD pnpm install --frozen-lockfile - $STD pnpm build - cd /opt/karakeep/apps/workers - $STD pnpm install --frozen-lockfile - $STD pnpm build - cd /opt/karakeep/apps/cli - $STD pnpm install --frozen-lockfile - $STD pnpm build - DATA_DIR="$(sed -n '/^DATA_DIR/p' /etc/karakeep/karakeep.env | awk -F= '{print $2}' | tr -d '="=')" - export DATA_DIR="${DATA_DIR:-/opt/karakeep_data}" - cd /opt/karakeep/packages/db - $STD pnpm migrate - $STD pnpm store prune - sed -i "s/^SERVER_VERSION=.*$/SERVER_VERSION=${RELEASE}/" /etc/karakeep/karakeep.env - msg_ok "Updated ${APP} to v${RELEASE}" - - msg_info "Starting Services" - systemctl start karakeep-browser karakeep-workers karakeep-web - msg_ok "Started Services" - - msg_info "Cleaning up" - $STD apt-get autoremove -y - $STD apt-get autoclean -y - msg_ok "Cleaned" - msg_ok "Updated Successfully" exit } diff --git a/ct/keycloak.sh b/ct/keycloak.sh index d50684b8c3..f5a70e3459 100644 --- a/ct/keycloak.sh +++ b/ct/keycloak.sh @@ -27,50 +27,42 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.keycloak_app 2>/dev/null)" ]] || [[ ! -f ~/.keycloak_app ]]; then + if check_for_gh_release "keycloak" "keycloak/keycloak"; then msg_info "Stopping Keycloak" systemctl stop keycloak msg_ok "Stopped Keycloak" - + msg_info "Updating packages" $STD apt-get update $STD apt-get -y upgrade msg_ok "Updated packages" - + msg_info "Backup old Keycloak" cd /opt mv keycloak keycloak.old msg_ok "Backup done" - + fetch_and_deploy_gh_release "keycloak_app" "keycloak/keycloak" "prebuild" "latest" "/opt/keycloak" "keycloak-*.tar.gz" - + msg_info "Updating ${APP}" cd /opt cp -a keycloak.old/conf/. keycloak/conf/ cp -a keycloak.old/providers/. keycloak/providers/ 2>/dev/null || true cp -a keycloak.old/themes/. keycloak/themes/ 2>/dev/null || true msg_ok "Updated ${APP} LXC" - + msg_info "Restarting Keycloak" systemctl restart keycloak msg_ok "Restarted Keycloak" - + msg_info "Cleaning up" rm -rf keycloak.old msg_ok "Cleanup complete" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } - start build_container description diff --git a/ct/koillection.sh b/ct/koillection.sh index d24a946326..b2e04e6a7a 100644 --- a/ct/koillection.sh +++ b/ct/koillection.sh @@ -27,8 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/benjaminjonard/koillection/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.koillection ]] || [[ "${RELEASE}" != "$(cat ~/.koillection)" ]]; then + if check_for_gh_release "koillection" "benjaminjonard/koillection"; then msg_info "Stopping Service" systemctl stop apache2 msg_ok "Stopped Service" @@ -36,10 +35,10 @@ function update_script() { msg_info "Creating a backup" mv /opt/koillection/ /opt/koillection-backup msg_ok "Backup created" - + fetch_and_deploy_gh_release "koillection" "benjaminjonard/koillection" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cd /opt/koillection cp -r /opt/koillection-backup/.env.local /opt/koillection cp -r /opt/koillection-backup/public/uploads/. /opt/koillection/public/uploads/ @@ -51,7 +50,7 @@ function update_script() { $STD yarn install $STD yarn build chown -R www-data:www-data /opt/koillection/public/uploads - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting Service" systemctl start apache2 @@ -60,10 +59,7 @@ function update_script() { msg_info "Cleaning up" rm -r /opt/koillection-backup msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/kometa.sh b/ct/kometa.sh index cfd0a43153..49b0fb619d 100644 --- a/ct/kometa.sh +++ b/ct/kometa.sh @@ -28,12 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | jq -r '.tag_name | sub("^v";"")') - if [[ "${RELEASE}" != "$(cat ~/.kometa 2>/dev/null)" ]] || [[ ! -f ~/.kometa ]]; then + if check_for_gh_release "kometa" "Kometa-Team/Kometa"; then msg_info "Stopping Service" systemctl stop kometa msg_ok "Stopped Service" @@ -43,7 +38,6 @@ function update_script() { msg_ok "Backup completed" PYTHON_VERSION="3.12" setup_uv - $STD uv python update-shell fetch_and_deploy_gh_release "kometa" "Kometa-Team/Kometa" msg_info "Updating Kometa" @@ -56,8 +50,6 @@ function update_script() { systemctl start kometa msg_ok "Started Service" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/komga.sh b/ct/komga.sh index b332c3d2d0..9f98b2f155 100644 --- a/ct/komga.sh +++ b/ct/komga.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/gotson/komga/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.komga-org ]] || [[ "${RELEASE}" != "$(cat ~/.komga-org)" ]]; then + if check_for_gh_release "komga" "gotson/komga"; then msg_info "Stopping ${APP}" systemctl stop komga msg_ok "Stopped ${APP}" @@ -41,10 +39,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start komga msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." fi exit } diff --git a/ct/kubo.sh b/ct/kubo.sh index 4a1089ce44..c4477d6b6d 100644 --- a/ct/kubo.sh +++ b/ct/kubo.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/ipfs/kubo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.kubo)" ]] || [[ ! -f ~/.kubo ]]; then + if check_for_gh_release "kubo" "ipfs/kubo"; then msg_info "Stopping service" systemctl stop ipfs msg_ok "Stopped service" @@ -39,10 +37,7 @@ function update_script() { msg_info "Starting service" systemctl start ipfs msg_ok "Service started" - - msg_ok "Updated successfuly" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated successfully" fi exit } diff --git a/ct/librespeed-rust.sh b/ct/librespeed-rust.sh index 0cf7344ede..d44fcc8e19 100644 --- a/ct/librespeed-rust.sh +++ b/ct/librespeed-rust.sh @@ -27,9 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest-rust/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.librespeed 2>/dev/null)" ]] || [[ ! -f ~/.librespeed ]]; then + + if check_for_gh_release "librespeed-rust" "librespeed/speedtest-rust"; then msg_info "Stopping Services" systemctl stop librespeed_rs msg_ok "Services Stopped" @@ -39,8 +38,7 @@ function update_script() { msg_info "Starting Service" systemctl start librespeed_rs msg_ok "Started Service" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/libretranslate.sh b/ct/libretranslate.sh index 12e529af00..6bd9183075 100644 --- a/ct/libretranslate.sh +++ b/ct/libretranslate.sh @@ -28,25 +28,21 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -s https://api.github.com/repos/LibreTranslate/LibreTranslate/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat $HOME/.libretranslate)" ]] || [[ ! -f $HOME/.libretranslate ]]; then + if check_for_gh_release "libretranslate" "LibreTranslate/LibreTranslate"; then msg_info "Stopping $APP" systemctl stop libretranslate msg_ok "Stopped $APP" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" cd /opt/libretranslate source .venv/bin/activate $STD pip install -U libretranslate - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start libretranslate msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/lidarr.sh b/ct/lidarr.sh index 8d232490a1..8e5ea761c3 100644 --- a/ct/lidarr.sh +++ b/ct/lidarr.sh @@ -28,28 +28,19 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get update - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Lidarr/Lidarr/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.lidarr)" ]] || [[ ! -f ~/.lidarr ]]; then + if check_for_gh_release "lidarr" "Lidarr/Lidarr"; then msg_info "Stopping service" systemctl stop lidarr msg_ok "Service stopped" fetch_and_deploy_gh_release "lidarr" "Lidarr/Lidarr" "prebuild" "latest" "/opt/Lidarr" "Lidarr.master*linux-core-x64.tar.gz" chmod 775 /opt/Lidarr - + msg_info "Starting service" systemctl start lidarr msg_ok "Service started" - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/linkwarden.sh b/ct/linkwarden.sh index eff00acbde..21d77cd878 100644 --- a/ct/linkwarden.sh +++ b/ct/linkwarden.sh @@ -26,8 +26,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/linkwarden/linkwarden/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat /opt/linkwarden_version.txt)" ]] || [[ ! -f /opt/linkwarden_version.txt ]]; then + if check_for_gh_release "linkwarden" "linkwarden/linkwarden"; then NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs msg_info "Stopping ${APP}" systemctl stop linkwarden @@ -35,11 +34,15 @@ function update_script() { RUST_CRATES="monolith" setup_rust - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Backing up data" mv /opt/linkwarden/.env /opt/.env [ -d /opt/linkwarden/data ] && mv /opt/linkwarden/data /opt/data.bak rm -rf /opt/linkwarden + msg_ok "Backed up data" + fetch_and_deploy_gh_release "linkwarden" "linkwarden/linkwarden" + + msg_info "Updating ${APP}" cd /opt/linkwarden $STD yarn $STD npx playwright install-deps @@ -49,7 +52,7 @@ function update_script() { $STD yarn web:build $STD yarn prisma:deploy [ -d /opt/data.bak ] && mv /opt/data.bak /opt/linkwarden/data - msg_ok "Updated ${APP} to ${RELEASE}" + msg_ok "Updated ${APP}" msg_info "Starting ${APP}" systemctl start linkwarden @@ -61,8 +64,6 @@ function update_script() { rm -rf /opt/linkwarden/.next/cache msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." fi exit } diff --git a/ct/listmonk.sh b/ct/listmonk.sh index a800f9a00b..0a0e812f12 100644 --- a/ct/listmonk.sh +++ b/ct/listmonk.sh @@ -27,12 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/knadh/listmonk/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.listmonk)" ]] || [[ ! -f ~/.listmonk ]]; then + if check_for_gh_release "listmonk" "knadh/listmonk"; then msg_info "Stopping ${APP}" systemctl stop listmonk msg_ok "Stopped ${APP}" @@ -56,10 +51,7 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/listmonk-backup/ msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/lubelogger.sh b/ct/lubelogger.sh index c899a46406..1d84c51d23 100644 --- a/ct/lubelogger.sh +++ b/ct/lubelogger.sh @@ -27,12 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/hargata/lubelog/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ ! -f ~/.lubelogger ]] || [[ "${RELEASE}" != "$(cat ~/.lubelogger)" ]]; then + if check_for_gh_release "lubelogger" "hargata/lubelog"; then msg_info "Stopping Service" systemctl stop lubelogger msg_ok "Stopped Service" @@ -67,10 +62,7 @@ function update_script() { msg_info "Cleaning up" rm -rf /tmp/lubeloggerData msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/mafl.sh b/ct/mafl.sh index 1bb540ec21..9b0823bfa6 100644 --- a/ct/mafl.sh +++ b/ct/mafl.sh @@ -27,30 +27,30 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/hywax/mafl/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.mafl 2>/dev/null)" ]] || [[ ! -f ~/.mafl ]]; then + if check_for_gh_release "mafl" "hywax/mafl"; then msg_info "Stopping Mafl service" systemctl stop mafl msg_ok "Service stopped" - msg_info "Performing backup" + msg_info "Backing up data" mkdir -p /opt/mafl-backup/data mv /opt/mafl/data /opt/mafl-backup/data rm -rf /opt/mafl msg_ok "Backup complete" - + fetch_and_deploy_gh_release "mafl" "hywax/mafl" - msg_info "Updating Mafl to v${RELEASE}" + msg_info "Updating Mafl" cd /opt/mafl - yarn install - yarn build + $STD yarn install + $STD yarn build mv /opt/mafl-backup/data /opt/mafl/data + msg_ok "Mafl updated" + + msg_info "Starting Service" systemctl start mafl - msg_ok "Updated Mafl to v${RELEASE}" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Service started" + msg_ok "Update successfully" fi exit } diff --git a/ct/magicmirror.sh b/ct/magicmirror.sh index 60c567390d..c349fa616f 100644 --- a/ct/magicmirror.sh +++ b/ct/magicmirror.sh @@ -27,12 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/MagicMirrorOrg/MagicMirror/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ ! -f ~/.magicmirror ]] || [[ "${RELEASE}" != "$(cat ~/.magicmirror)" ]]; then + if check_for_gh_release "magicmirror" "MagicMirrorOrg/MagicMirror"; then msg_info "Stopping Service" systemctl stop magicmirror msg_ok "Stopped Service" @@ -62,10 +57,7 @@ function update_script() { msg_info "Starting Service" systemctl start magicmirror msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/managemydamnlife.sh b/ct/managemydamnlife.sh index 34eda87da7..4648e3834e 100644 --- a/ct/managemydamnlife.sh +++ b/ct/managemydamnlife.sh @@ -28,12 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.mmdl)" ]] || [[ ! -f ~/.mmdl ]]; then + if check_for_gh_release "mmdl" "intri-in/manage-my-damn-life-nextjs"; then msg_info "Stopping service" systemctl stop mmdl msg_ok "Stopped service" @@ -54,10 +49,7 @@ function update_script() { msg_info "Starting service" systemctl start mmdl msg_ok "Started service" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/mealie.sh b/ct/mealie.sh index 3e351cd217..615c886399 100644 --- a/ct/mealie.sh +++ b/ct/mealie.sh @@ -28,10 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/mealie-recipes/mealie/releases/latest | jq -r '.tag_name | sub("^v"; "")') - if [[ "${RELEASE}" != "$(cat ~/.mealie 2>/dev/null)" ]] || [[ ! -f ~/.mealie ]]; then - + if check_for_gh_release "mealie" "mealie-recipes/mealie"; then PYTHON_VERSION="3.12" setup_uv NODE_MODULE="yarn" NODE_VERSION="20" setup_nodejs @@ -79,10 +76,7 @@ function update_script() { msg_info "Starting $APP" systemctl start mealie msg_ok "Started $APP" - - msg_ok "Update to $RELEASE Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Update Successful" fi exit } diff --git a/ct/mediamanager.sh b/ct/mediamanager.sh index 2a3a14810f..6aff031066 100644 --- a/ct/mediamanager.sh +++ b/ct/mediamanager.sh @@ -30,8 +30,7 @@ function update_script() { setup_uv - RELEASE=$(curl -fsSL https://api.github.com/repos/maxdorninger/MediaManager/releases/latest | jq '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.mediamanager 2>/dev/null)" ]] || [[ ! -f ~/.mediamanager ]]; then + if check_for_gh_release "mediamanager" "maxdorninger/MediaManager"; then msg_info "Stopping Service" systemctl stop mediamanager msg_ok "Stopped Service" @@ -61,10 +60,7 @@ function update_script() { msg_info "Starting Service" systemctl start mediamanager msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "Already up to date" fi exit } diff --git a/ct/mediamtx.sh b/ct/mediamtx.sh index 6987291b0f..c838550e73 100644 --- a/ct/mediamtx.sh +++ b/ct/mediamtx.sh @@ -24,28 +24,21 @@ function update_script() { check_container_storage check_container_resources if [[ ! -d /opt/mediamtx/ ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq + msg_error "No ${APP} Installation Found!" + exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/bluenviron/mediamtx/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.mediamtx)" ]] || [[ ! -f ~/.mediamtx ]]; then + if check_for_gh_release "mediamtx" "bluenviron/mediamtx"; then msg_info "Stopping service" systemctl stop mediamtx msg_ok "Service stopped" fetch_and_deploy_gh_release "mediamtx" "bluenviron/mediamtx" "prebuild" "latest" "/opt/mediamtx" "mediamtx*linux_amd64.tar.gz" - + msg_info "Starting service" systemctl start mediamtx msg_ok "Service started" - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/meilisearch.sh b/ct/meilisearch.sh index c33ffe0186..8ef4eb70ba 100644 --- a/ct/meilisearch.sh +++ b/ct/meilisearch.sh @@ -30,15 +30,18 @@ function update_script() { 3>&1 1>&2 2>&3) if [ "$UPD" == "1" ]; then - msg_info "Stopping Meilisearch" - systemctl stop meilisearch - msg_ok "Stopped Meilisearch" + if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then + msg_info "Stopping Meilisearch" + systemctl stop meilisearch + msg_ok "Stopped Meilisearch" - fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" + fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" - msg_info "Starting Meilisearch" - systemctl start meilisearch - msg_ok "Started Meilisearch" + msg_info "Starting Meilisearch" + systemctl start meilisearch + msg_ok "Started Meilisearch" + msg_ok "Update Successfully" + fi exit fi @@ -47,24 +50,27 @@ function update_script() { msg_error "No Meilisearch-UI Installation Found!" exit fi - msg_info "Stopping Meilisearch-UI" - systemctl stop meilisearch-ui - msg_ok "Stopped Meilisearch-UI" + if check_for_gh_release "meilisearch-ui" "riccox/meilisearch-ui"; then + msg_info "Stopping Meilisearch-UI" + systemctl stop meilisearch-ui + msg_ok "Stopped Meilisearch-UI" - cp /opt/meilisearch-ui/.env.local /tmp/.env.local.bak - rm -rf /opt/meilisearch-ui - fetch_and_deploy_gh_release "meilisearch-ui" "riccox/meilisearch-ui" "tarball" + cp /opt/meilisearch-ui/.env.local /tmp/.env.local.bak + rm -rf /opt/meilisearch-ui + fetch_and_deploy_gh_release "meilisearch-ui" "riccox/meilisearch-ui" "tarball" - msg_info "Configuring Meilisearch-UI" - cd /opt/meilisearch-ui - sed -i 's|const hash = execSync("git rev-parse HEAD").toString().trim();|const hash = "unknown";|' /opt/meilisearch-ui/vite.config.ts - mv /tmp/.env.local.bak /opt/meilisearch-ui/.env.local - $STD pnpm install - msg_ok "Configured Meilisearch-UI" + msg_info "Configuring Meilisearch-UI" + cd /opt/meilisearch-ui + sed -i 's|const hash = execSync("git rev-parse HEAD").toString().trim();|const hash = "unknown";|' /opt/meilisearch-ui/vite.config.ts + mv /tmp/.env.local.bak /opt/meilisearch-ui/.env.local + $STD pnpm install + msg_ok "Configured Meilisearch-UI" - msg_info "Starting Meilisearch-UI" - systemctl start meilisearch-ui - msg_ok "Started Meilisearch-UI" + msg_info "Starting Meilisearch-UI" + systemctl start meilisearch-ui + msg_ok "Started Meilisearch-UI" + msg_ok "Update Successfully" + fi exit fi } diff --git a/ct/memos.sh b/ct/memos.sh index 893af104b6..1297c8cc4c 100644 --- a/ct/memos.sh +++ b/ct/memos.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/usememos/memos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.memos 2>/dev/null)" ]] || [[ ! -f ~/.memos ]]; then + if check_for_gh_release "memos" "usememos/memos"; then msg_info "Stopping service" systemctl stop memos msg_ok "Service stopped" @@ -39,10 +37,7 @@ function update_script() { msg_info "Starting service" systemctl start memos msg_ok "Service started" - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/monica.sh b/ct/monica.sh index 35aa7c91e8..26686e3c40 100644 --- a/ct/monica.sh +++ b/ct/monica.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/monicahq/monica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.monica ]] || [[ "${RELEASE}" != "$(cat ~/.monica)" ]]; then + if check_for_gh_release "monica" "monicahq/monica"; then msg_info "Stopping Service" systemctl stop apache2 msg_ok "Stopped Service" @@ -40,7 +38,7 @@ function update_script() { fetch_and_deploy_gh_release "monica" "monicahq/monica" "prebuild" "latest" "/opt/monica" "monica-v*.tar.bz2" - msg_info "Configuring monica" + msg_info "Configuring monica" cd /opt/monica/ cp -r /opt/monica-backup/.env /opt/monica cp -r /opt/monica-backup/storage/* /opt/monica/storage/ @@ -59,10 +57,7 @@ function update_script() { msg_info "Cleaning up" rm -r /opt/monica-backup msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/myspeed.sh b/ct/myspeed.sh index d198026c7e..5ffab29f43 100644 --- a/ct/myspeed.sh +++ b/ct/myspeed.sh @@ -27,11 +27,10 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://github.com/gnmyt/myspeed/releases/latest | grep "title>Release" | cut -d " " -f 5) - if [[ ! -f ~/.myspeed ]] || [[ "${RELEASE}" != "$(cat ~/.myspeed)" ]]; then - msg_info "Stopping ${APP} Service" + if check_for_gh_release "myspeed" "gnmyt/myspeed"; then + msg_info "Stopping Service" systemctl stop myspeed - msg_ok "Stopped ${APP} Service" + msg_ok "Stopped Service" msg_info "Creating backup" cd /opt @@ -41,22 +40,19 @@ function update_script() { fetch_and_deploy_gh_release "myspeed" "gnmyt/myspeed" "prebuild" "latest" "/opt/myspeed" "MySpeed-*.zip" - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" cd /opt/myspeed $STD npm install if [[ -d /opt/myspeed_bak/data ]]; then mkdir -p /opt/myspeed/data/ cp -r /opt/myspeed_bak/data/* /opt/myspeed/data/ fi - msg_ok "Updated ${APP} to ${RELEASE}" + msg_ok "Updated ${APP}" - msg_info "Starting ${APP} Service" + msg_info "Starting Service" systemctl start myspeed - msg_ok "Started ${APP} Service" - + msg_ok "Started Service" msg_ok "Updated Successfully!\n" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/navidrome.sh b/ct/navidrome.sh index d817a82fcd..d723286296 100644 --- a/ct/navidrome.sh +++ b/ct/navidrome.sh @@ -20,31 +20,27 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /var/lib/navidrome ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/navidrome/navidrome/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.navidrome 2>/dev/null)" ]] || [[ ! -f ~/.navidrome ]]; then - msg_info "Stopping Services" - systemctl stop navidrome - msg_ok "Services Stopped" - - fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary" - - msg_info "Starting Services" - systemctl start navidrome - msg_ok "Started Services" - - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /var/lib/navidrome ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "navidrome" "navidrome/navidrome"; then + msg_info "Stopping Services" + systemctl stop navidrome + msg_ok "Services Stopped" + + fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary" + + msg_info "Starting Services" + systemctl start navidrome + msg_ok "Started Services" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/nocodb.sh b/ct/nocodb.sh index fe028d9dec..5ec8b36cdc 100644 --- a/ct/nocodb.sh +++ b/ct/nocodb.sh @@ -20,16 +20,14 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/nocodb.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/nocodb/nocodb/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.nocodb ]] || [[ "${RELEASE}" != "$(cat ~/.nocodb)" ]]; then + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/nocodb.service ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + if check_for_gh_release "nocodb" "nocodb/nocodb"; then msg_info "Stopping Service" systemctl stop nocodb msg_ok "Stopped Service" @@ -39,10 +37,7 @@ function update_script() { msg_info "Starting Service" systemctl start nocodb msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/nodebb.sh b/ct/nodebb.sh index e806e36094..8057535a91 100644 --- a/ct/nodebb.sh +++ b/ct/nodebb.sh @@ -30,26 +30,21 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/NodeBB/NodeBB/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.nodebb)" ]] || [[ ! -f ~/.nodebb ]]; then + if check_for_gh_release "nodebb" "NodeBB/NodeBB"; then msg_info "Stopping ${APP}" systemctl stop nodebb msg_ok "Stopped ${APP}" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" cd /opt/nodebb $STD ./nodebb upgrade - echo "${RELEASE}" > ~/.nodebb - msg_ok "Updated ${APP} to v${RELEASE}" + echo "${CHECK_UPDATE_RELEASE}" >~/.nodebb + msg_ok "Updated ${APP}" msg_info "Starting ${APP}" systemctl start nodebb msg_ok "Started ${APP}" - msg_ok "Updated Successfully\n" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/oauth2-proxy.sh b/ct/oauth2-proxy.sh index 0e0dd2c47c..84644a1ab7 100644 --- a/ct/oauth2-proxy.sh +++ b/ct/oauth2-proxy.sh @@ -28,22 +28,17 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/oauth2-proxy/oauth2-proxy/releases/latest | jq -r .tag_name | sed 's/^v//') - if [[ ! -f ~/.oauth2-proxy ]] || [[ "${RELEASE}" != "$(cat ~/.oauth2-proxy)" ]]; then - msg_info "Stopping ${APP} services" + if check_for_gh_release "oauth2-proxy" "oauth2-proxy/oauth2-proxy"; then + msg_info "Stopping Service" systemctl stop oauth2-proxy - msg_ok "Stopped ${APP} service" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "oauth2-proxy" "oauth2-proxy/oauth2-proxy" "prebuild" "latest" "/opt/oauth2-proxy" "oauth2-proxy*linux-amd64.tar.gz" - msg_info "Starting ${APP} service" + msg_info "Starting Service" systemctl start oauth2-proxy - msg_ok "Started ${APP} service" - + msg_ok "Started Service" msg_ok "Updated successfully!\n" - else - msg_ok "${APP} is already up to date (${RELEASE})" fi } diff --git a/ct/ombi.sh b/ct/ombi.sh index f86e4c3614..36e0f0f33e 100644 --- a/ct/ombi.sh +++ b/ct/ombi.sh @@ -27,12 +27,10 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Ombi-app/Ombi/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.ombi)" ]] || [[ ! -f ~/.ombi ]]; then - msg_info "Stopping ${APP} service" + if check_for_gh_release "ombi" "Ombi-app/Ombi"; then + msg_info "Stopping Service" systemctl stop ombi - msg_ok "Stopped ${APP} service" + msg_ok "Stopped Service" msg_info "Creating backup" [[ -f /opt/ombi/Ombi.db ]] && mv /opt/ombi/Ombi.db /opt @@ -46,13 +44,10 @@ function update_script() { [[ -f /opt/OmbiExternal.db ]] && mv /opt/OmbiExternal.db /opt/ombi [[ -f /opt/OmbiSettings.db ]] && mv /opt/OmbiSettings.db /opt/ombi - msg_info "Starting ${APP} service" + msg_info "Starting Service" systemctl start ombi - msg_ok "Started ${APP} service" - + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} ia already at ${RELEASE}." fi exit } diff --git a/ct/opengist.sh b/ct/opengist.sh index 57b54f17bf..7631ad202c 100644 --- a/ct/opengist.sh +++ b/ct/opengist.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/thomiceli/opengist/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.opengist ]] || [[ "${RELEASE}" != "$(cat ~/.opengist)" ]]; then + if check_for_gh_release "opengist" "thomiceli/opengist"; then msg_info "Stopping Service" systemctl stop opengist msg_ok "Stopped Service" @@ -37,20 +35,17 @@ function update_script() { msg_info "Creating backup" mv /opt/opengist /opt/opengist-backup msg_ok "Backup created" - + fetch_and_deploy_gh_release "opengist" "thomiceli/opengist" "prebuild" "latest" "/opt/opengist" "opengist*linux-amd64.tar.gz" - msg_info "Configuring ${APP}" + msg_info "Restoring Configuration" mv /opt/opengist-backup/config.yml /opt/opengist/config.yml - msg_ok "Configured ${APP}" + msg_ok "Configuration Restored" msg_info "Starting Service" systemctl start opengist msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/ots.sh b/ct/ots.sh index 00e9199fe8..bfbec2895c 100644 --- a/ct/ots.sh +++ b/ct/ots.sh @@ -20,32 +20,28 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/ots ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Luzifer/ots/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.ots 2>/dev/null)" ]] || [[ ! -f ~/.ots ]]; then - msg_info "Stopping ${APP} Service" - systemctl stop ots - systemctl stop nginx - msg_ok "Stopped ${APP} Service" - - fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz" - - msg_info "Stopping ${APP} Service" - systemctl start ots - systemctl start nginx - msg_ok "Stopped ${APP} Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/ots ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + if check_for_gh_release "ots" "Luzifer/ots"; then + msg_info "Stopping Services" + systemctl stop ots + systemctl stop nginx + msg_ok "Stopped Services" + + fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz" + + msg_info "Starting Services" + systemctl start ots + systemctl start nginx + msg_ok "Started Services" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/outline.sh b/ct/outline.sh index a6b6d033f0..c94eb63bca 100644 --- a/ct/outline.sh +++ b/ct/outline.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.outline ]] || [[ "${RELEASE}" != "$(cat ~/.outline)" ]]; then + if check_for_gh_release "outline" "outline/outline"; then msg_info "Stopping Services" systemctl stop outline msg_ok "Services Stopped" @@ -40,7 +39,7 @@ function update_script() { fetch_and_deploy_gh_release "outline" "outline/outline" "tarball" - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" cd /opt/outline mv /opt/.env /opt/outline export NODE_ENV=development @@ -53,10 +52,7 @@ function update_script() { msg_info "Starting Services" systemctl start outline msg_ok "Started Services" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/overseerr.sh b/ct/overseerr.sh index 7e5c9937ec..0f545f8dd6 100644 --- a/ct/overseerr.sh +++ b/ct/overseerr.sh @@ -27,10 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/sct/overseerr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.overseerr ]] || [[ "${RELEASE}" != "$(cat ~/.overseerr)" ]]; then - msg_info "Stopping ${APP} service" + if check_for_gh_release "overseerr" "sct/overseerr"; then + msg_info "Stopping Service" systemctl stop overseerr msg_ok "Service stopped" @@ -48,13 +46,10 @@ function update_script() { mv /opt/config_backup /opt/overseerr/config msg_ok "Configured ${APP}" - msg_info "Starting ${APP} service" + msg_info "Starting Service" systemctl start overseerr - msg_ok "Started ${APP} service" - + msg_ok "Started Service" msg_ok "Updated successfully!" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/owncast.sh b/ct/owncast.sh index 4cbc786d49..6d2eda7b42 100644 --- a/ct/owncast.sh +++ b/ct/owncast.sh @@ -20,31 +20,26 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/owncast ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/owncast/owncast/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.owncast ]] || [[ "${RELEASE}" != "$(cat ~/.owncast)" ]]; then - msg_info "Stopping ${APP}" - systemctl stop owncast - msg_ok "Stopped ${APP}" - - fetch_and_deploy_gh_release "owncast" "owncast/owncast" "prebuild" "latest" "/opt/owncast" "owncast*linux-64bit.zip" - - msg_info "Starting ${APP}" - systemctl start owncast - msg_ok "Started ${APP}" - - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/owncast ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + if check_for_gh_release "owncast" "owncast/owncast"; then + msg_info "Stopping Service" + systemctl stop owncast + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "owncast" "owncast/owncast" "prebuild" "latest" "/opt/owncast" "owncast*linux-64bit.zip" + + msg_info "Starting Service" + systemctl start owncast + msg_ok "Started Service" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/pairdrop.sh b/ct/pairdrop.sh index 2657d09de3..46aca3675a 100644 --- a/ct/pairdrop.sh +++ b/ct/pairdrop.sh @@ -20,36 +20,31 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/pairdrop ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/schlagmichdoch/PairDrop/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.pairdrop ]] || [[ "${RELEASE}" != "$(cat ~/.pairdrop)" ]]; then - msg_info "Stopping ${APP}" - systemctl stop pairdrop - msg_ok "Stopped ${APP}" - - fetch_and_deploy_gh_release "pairdrop" "schlagmichdoch/PairDrop" "tarball" - - msg_info "Configuring PairDrop" - cd /opt/pairdrop - $STD npm install - msg_ok "Configured PairDrop" - - msg_info "Starting ${APP}" - systemctl start pairdrop - msg_ok "Started ${APP}" - - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/pairdrop ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + if check_for_gh_release "pairdrop" "schlagmichdoch/PairDrop"; then + msg_info "Stopping Service" + systemctl stop pairdrop + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "pairdrop" "schlagmichdoch/PairDrop" "tarball" + + msg_info "Configuring PairDrop" + cd /opt/pairdrop + $STD npm install + msg_ok "Configured PairDrop" + + msg_info "Starting Service" + systemctl start pairdrop + msg_ok "Started Service" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/palmr.sh b/ct/palmr.sh index 61fc34e400..567869ebc1 100644 --- a/ct/palmr.sh +++ b/ct/palmr.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/kyantech/palmr/releases/latest | jq '.tag_name' | sed 's/^"v//;s/"$//') - if [[ "${RELEASE}" != "$(cat ~/.palmr 2>/dev/null)" ]] || [[ ! -f ~/.palmr ]]; then + if check_for_gh_release "palmr" "kyantech/Palmr"; then msg_info "Stopping Services" systemctl stop palmr-frontend palmr-backend msg_ok "Stopped Services" @@ -56,15 +54,12 @@ function update_script() { $STD pnpm install $STD pnpm build chown -R palmr:palmr /opt/palmr_data /opt/palmr - msg_ok "Updated $APP" + msg_ok "Updated ${APP}" msg_info "Starting Services" systemctl start palmr-backend palmr-frontend msg_ok "Started Services" - msg_ok "Updated Successfully" - else - msg_ok "Already up to date" fi exit } diff --git a/ct/paperless-ngx.sh b/ct/paperless-ngx.sh index 88be474dcb..cdce8cdb21 100644 --- a/ct/paperless-ngx.sh +++ b/ct/paperless-ngx.sh @@ -27,11 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/paperless-ngx/paperless-ngx/releases/latest | jq -r .tag_name | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.paperless 2>/dev/null)" ]] || [[ ! -f ~/.paperless ]]; then + if check_for_gh_release "paperless-ngx" "paperless-ngx/paperless-ngx"; then msg_info "Stopping all Paperless-ngx Services" systemctl stop paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue msg_ok "Stopped all Paperless-ngx Services" @@ -50,13 +46,13 @@ function update_script() { fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc" setup_gs - msg_info "Updating to ${RELEASE}" + msg_info "Updating Paperless-ngx" cp -r /opt/paperless/backup/* /opt/paperless/ cd /opt/paperless $STD uv sync --all-extras cd /opt/paperless/src $STD uv run -- python manage.py migrate - msg_ok "Updated to ${RELEASE}" + msg_ok "Updated Paperless-ngx" else msg_warn "You are about to migrate your Paperless-ngx installation to uv!" msg_custom "🔒" "It is strongly recommended to take a Proxmox snapshot first:" @@ -117,7 +113,7 @@ function update_script() { $STD uv sync --all-extras cd /opt/paperless/src $STD uv run -- python manage.py migrate - msg_ok "Paperless-ngx migration and update to ${RELEASE} completed" + msg_ok "Paperless-ngx migration and update completed" fi msg_info "Starting all Paperless-ngx Services" @@ -125,8 +121,6 @@ function update_script() { sleep 1 msg_ok "Started all Paperless-ngx Services" msg_ok "Updated Successfully!\n" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } @@ -139,4 +133,3 @@ msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}" - diff --git a/ct/paymenter.sh b/ct/paymenter.sh index 47da150ee8..b2361ff0ca 100644 --- a/ct/paymenter.sh +++ b/ct/paymenter.sh @@ -36,15 +36,12 @@ function update_script() { $STD systemctl reload nginx fi - RELEASE=$(curl -fsSL https://api.github.com/repos/paymenter/paymenter/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.paymenter ]] || [[ "${RELEASE}" != "$(cat ~/.paymenter)" ]]; then - msg_info "Updating ${APP} to ${RELEASE}" + if check_for_gh_release "paymenter" "paymenter/paymenter"; then + msg_info "Updating ${APP}" cd /opt/paymenter $STD php artisan p:upgrade --no-interaction - echo "${RELEASE}" >~/.paymenter + echo "${CHECK_UPDATE_RELEASE}" >~/.paymenter msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." fi exit } diff --git a/ct/peanut.sh b/ct/peanut.sh index cfe836d8f8..7324c4c520 100644 --- a/ct/peanut.sh +++ b/ct/peanut.sh @@ -27,33 +27,29 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs - RELEASE=$(curl -fsSL https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.peanut 2>/dev/null)" ]] || [[ ! -f ~/.peanut ]]; then + NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs + + if check_for_gh_release "peanut" "Brandawg93/PeaNUT"; then msg_info "Stopping $APP" systemctl stop peanut msg_ok "Stopped $APP" fetch_and_deploy_gh_release "peanut" "Brandawg93/PeaNUT" "tarball" "latest" "/opt/peanut" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" cd /opt/peanut $STD pnpm i $STD pnpm run build:local cp -r .next/static .next/standalone/.next/ mkdir -p /opt/peanut/.next/standalone/config ln -sf /etc/peanut/settings.yml /opt/peanut/.next/standalone/config/settings.yml - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start peanut msg_ok "Started $APP" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/pf2etools.sh b/ct/pf2etools.sh index 2f9dc9db1e..ad39ae384f 100644 --- a/ct/pf2etools.sh +++ b/ct/pf2etools.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Pf2eToolsOrg/Pf2eTools/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.pf2etools 2>/dev/null)" ]] || [[ ! -f ~/.pf2etools ]]; then + if check_for_gh_release "pf2etools" "Pf2eToolsOrg/Pf2eTools"; then msg_info "Updating System" $STD apt-get update $STD apt-get -y upgrade @@ -46,10 +44,7 @@ function update_script() { chown -R www-data: "/opt/${APP}" chmod -R 755 "/opt/${APP}" msg_ok "Updated ${APP}" - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/photoprism.sh b/ct/photoprism.sh index 0242893483..bb10b8c5a5 100644 --- a/ct/photoprism.sh +++ b/ct/photoprism.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/photoprism/photoprism/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.photoprism 2>/dev/null)" ]] || [[ ! -f ~/.photoprism ]]; then + if check_for_gh_release "photoprism" "photoprism/photoprism"; then msg_info "Stopping PhotoPrism" systemctl stop photoprism msg_ok "Stopped PhotoPrism" @@ -51,11 +49,10 @@ function update_script() { systemctl start photoprism msg_ok "Started PhotoPrism" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } + start build_container description diff --git a/ct/phpipam.sh b/ct/phpipam.sh index b6209b8945..39e80c135c 100644 --- a/ct/phpipam.sh +++ b/ct/phpipam.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/phpipam/phpipam/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.phpipam ]] || [[ "${RELEASE}" != "$(cat ~/.phpipam 2>/dev/null)" ]]; then + if check_for_gh_release "phpipam" "phpipam/phpipam"; then msg_info "Stopping Service" systemctl stop apache2 msg_ok "Stopped Service" @@ -45,10 +44,7 @@ function update_script() { msg_info "Cleaning up" rm -r /opt/phpipam-backup msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/planka.sh b/ct/planka.sh index a47c6e6c97..762b58bb3a 100644 --- a/ct/planka.sh +++ b/ct/planka.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -s https://api.github.com/repos/plankanban/planka/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.planka 2>/dev/null)" ]] || [[ ! -f ~/.planka ]]; then + if check_for_gh_release "planka" "plankanban/planka"; then msg_info "Stopping $APP" systemctl stop planka msg_ok "Stopped $APP" @@ -45,9 +44,12 @@ function update_script() { msg_ok "Backed up data" fetch_and_deploy_gh_release "planka" "plankanban/planka" "prebuild" "latest" "/opt/planka" "planka-prebuild.zip" + + msg_info "Update Frontend" cd /opt/planka $STD npm install - + msg_ok "Updated Frontend" + msg_info "Restoring data" mv /opt/planka-backup/.env /opt/planka/ [ -d /opt/planka-backup/favicons ] && find /opt/planka-backup/favicons -maxdepth 1 -type f -exec mv -t /opt/planka/public/favicons {} + @@ -59,10 +61,7 @@ function update_script() { msg_info "Starting $APP" systemctl start planka msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/plant-it.sh b/ct/plant-it.sh index 4dc90d1a44..6635178f9c 100644 --- a/ct/plant-it.sh +++ b/ct/plant-it.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/MDeLuise/plant-it/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.plant-it 2>/dev/null)" ]] || [[ ! -f ~/.plant-it ]]; then + if check_for_gh_release "plant-it" "MDeLuise/plant-it"; then msg_info "Stopping $APP" systemctl stop plant-it msg_ok "Stopped $APP" @@ -41,8 +39,6 @@ function update_script() { systemctl start plant-it msg_ok "Started $APP" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/pocketbase.sh b/ct/pocketbase.sh index 219126660b..ebe38d7e4f 100644 --- a/ct/pocketbase.sh +++ b/ct/pocketbase.sh @@ -27,25 +27,20 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -s https://api.github.com/repos/pocketbase/pocketbase/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.pocketbase 2>/dev/null)" ]] || [[ ! -f ~/.pocketbase ]]; then + if check_for_gh_release "pocketbase" "pocketbase/pocketbase"; then msg_info "Stopping ${APP}" systemctl stop pocketbase msg_ok "Stopped ${APP}" msg_info "Updating ${APP}" /opt/pocketbase/pocketbase update - echo "${RELEASE}" > ~/.pocketbase + echo "${CHECK_UPDATE_RELEASE}" >~/.pocketbase msg_ok "Updated ${APP}" msg_info "Starting ${APP}" systemctl start pocketbase msg_ok "Started ${APP}" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/pocketid.sh b/ct/pocketid.sh index 0b0c0cce44..d307a884c8 100755 --- a/ct/pocketid.sh +++ b/ct/pocketid.sh @@ -29,11 +29,9 @@ function update_script() { exit fi - [[ -f /opt/${APP}_version.txt ]] && mv /opt/${APP}_version.txt ~/.pocket-id - RELEASE=$(curl -fsSL https://api.github.com/repos/pocket-id/pocket-id/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.pocket-id)" ]] || [[ ! -f ~/.pocket-id ]]; then + if check_for_gh_release "pocket-id" "pocket-id/pocket-id"; then if [[ "$(cat ~/.pocket-id)" < "1.0.0" ]]; then - msg_info "Migrating ${APP} to v${RELEASE}" + msg_info "Migrating ${APP}" systemctl -q disable --now pocketid-backend pocketid-frontend caddy mv /etc/caddy/Caddyfile ~/Caddyfile.bak $STD apt remove --purge caddy nodejs -y @@ -71,10 +69,7 @@ function update_script() { msg_info "Starting $APP" systemctl start pocketid msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/privatebin.sh b/ct/privatebin.sh index cad70707cd..3a34f39b4f 100644 --- a/ct/privatebin.sh +++ b/ct/privatebin.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/PrivateBin/PrivateBin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.privatebin ]] || [[ "${RELEASE}" != "$(cat ~/.privatebin)" ]]; then + if check_for_gh_release "privatebin" "PrivateBin/PrivateBin"; then msg_info "Creating backup" cp -f /opt/privatebin/cfg/conf.php /tmp/privatebin_conf.bak msg_ok "Backup created" @@ -44,10 +42,7 @@ function update_script() { chmod -R 0755 /opt/privatebin/data} systemctl reload nginx php8.2-fpm msg_ok "Configured ${APP}" - msg_ok "Successfully updated" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/prometheus-alertmanager.sh b/ct/prometheus-alertmanager.sh index 4367a84dd1..2be327272a 100755 --- a/ct/prometheus-alertmanager.sh +++ b/ct/prometheus-alertmanager.sh @@ -27,22 +27,17 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/prometheus/alertmanager/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.alertmanager ]] || [[ "${RELEASE}" != "$(cat ~/.alertmanager)" ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "alertmanager" "prometheus/alertmanager"; then + msg_info "Stopping Service" systemctl stop prometheus-alertmanager - msg_ok "Stopped ${APP}" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "alertmanager" "prometheus/alertmanager" "prebuild" "latest" "/usr/local/bin/" "alertmanager*linux-amd64.tar.gz" - msg_info "Starting ${APP}" + msg_info "Starting Service" systemctl start prometheus-alertmanager - msg_ok "Started ${APP}" - + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/prometheus-paperless-ngx-exporter.sh b/ct/prometheus-paperless-ngx-exporter.sh index f7ea565d57..e6f984d5e4 100755 --- a/ct/prometheus-paperless-ngx-exporter.sh +++ b/ct/prometheus-paperless-ngx-exporter.sh @@ -27,22 +27,17 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/hansmi/prometheus-paperless-exporter/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.prom-paperless-exp ]] || [[ "${RELEASE}" != "$(cat prom-paperless-exp 2>/dev/null)" ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter"; then + msg_info "Stopping Service" systemctl stop prometheus-paperless-ngx-exporter - msg_ok "Stopped ${APP}" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "prom-paperless-exp" "hansmi/prometheus-paperless-exporter" "binary" - msg_info "Starting ${APP}" + msg_info "Starting Service" systemctl start prometheus-paperless-ngx-exporter - msg_ok "Started ${APP}" - + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/prometheus.sh b/ct/prometheus.sh index 476acac7a3..5a11e958db 100644 --- a/ct/prometheus.sh +++ b/ct/prometheus.sh @@ -27,22 +27,19 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/prometheus/prometheus/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.prometheus ]] || [[ "${RELEASE}" != "$(cat ~/.prometheus 2>/dev/null)" ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "prometheus" "prometheus/prometheus"; then + msg_info "Stopping Service" systemctl stop prometheus - msg_ok "Stopped ${APP}" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "prometheus" "prometheus/prometheus" "prebuild" "latest" "/usr/local/bin" "*linux-amd64.tar.gz" rm -f /usr/local/bin/prometheus.yml - msg_info "Starting ${APP}" + msg_info "Starting Service" systemctl start prometheus - msg_ok "Started ${APP}" + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/prowlarr.sh b/ct/prowlarr.sh index af51a07797..a59e699fac 100644 --- a/ct/prowlarr.sh +++ b/ct/prowlarr.sh @@ -27,17 +27,20 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + if check_for_gh_release "prowlarr" "Prowlarr/Prowlarr"; then + msg_info "Stopping Service" + systemctl stop prowlarr + msg_ok "Stopped Service" - RELEASE=$(curl -fsSL https://api.github.com/repos/Prowlarr/Prowlarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.prowlarr 2>/dev/null)" ]] || [[ ! -f ~/.prowlarr ]]; then rm -rf /opt/Prowlarr fetch_and_deploy_gh_release "prowlarr" "Prowlarr/Prowlarr" "prebuild" "latest" "/opt/Prowlarr" "Prowlarr.master*linux-core-x64.tar.gz" chmod 775 /opt/Prowlarr - msg_ok "Successfully updated" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + msg_info "Starting Service" + systemctl start prowlarr + msg_ok "Started Service" + msg_ok "Updated Successfully" + fi exit } diff --git a/ct/ps5-mqtt.sh b/ct/ps5-mqtt.sh index c10f4fc288..218fce45ce 100644 --- a/ct/ps5-mqtt.sh +++ b/ct/ps5-mqtt.sh @@ -20,38 +20,32 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/ps5-mqtt ]]; then - msg_error "No ${APP} installation found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/FunkeyFlo/ps5-mqtt/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.ps5-mqtt 2>/dev/null)" ]] || [[ ! -f ~/.ps5-mqtt ]]; then - msg_info "Stopping service" - systemctl stop ps5-mqtt - msg_ok "Stopped service" - - fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball" - - msg_info "Configuring ${APP}" - cd /opt/ps5-mqtt/ps5-mqtt/ - $STD npm install - $STD npm run build - msg_ok "Configured ${APP}" - - msg_info "Starting service" - systemctl start ps5-mqtt - msg_ok "Started service" - - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi - + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/ps5-mqtt ]]; then + msg_error "No ${APP} installation found!" exit + fi + if check_for_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt"; then + msg_info "Stopping service" + systemctl stop ps5-mqtt + msg_ok "Stopped service" + + fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball" + + msg_info "Configuring ${APP}" + cd /opt/ps5-mqtt/ps5-mqtt/ + $STD npm install + $STD npm run build + msg_ok "Configured ${APP}" + + msg_info "Starting service" + systemctl start ps5-mqtt + msg_ok "Started service" + msg_ok "Updated successfully" + fi + exit } start diff --git a/ct/pulse.sh b/ct/pulse.sh index f4ec7cffb3..6de0c8689b 100644 --- a/ct/pulse.sh +++ b/ct/pulse.sh @@ -32,13 +32,11 @@ function update_script() { msg_error "Old Installation Found! Please recreate the container due big changes in the software." exit 1 fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name' | sed 's/^v//') - SERVICE_PATH="/etc/systemd/system" - if [[ "${RELEASE}" != "$(cat ~/.pulse 2>/dev/null)" ]] || [[ ! -f ~/.pulse ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "pulse" "rcourtman/Pulse"; then + SERVICE_PATH="/etc/systemd/system" + msg_info "Stopping Services" systemctl stop pulse*.service - msg_ok "Stopped ${APP}" + msg_ok "Stopped Services" if [[ -f /opt/pulse/pulse ]]; then rm -f /opt/pulse/pulse @@ -56,13 +54,10 @@ function update_script() { usermod -s /usr/sbin/nologin pulse fi - msg_info "Starting ${APP}" + msg_info "Starting Services" systemctl start pulse-backend - msg_ok "Started ${APP}" - + msg_ok "Started Services" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/qbittorrent.sh b/ct/qbittorrent.sh index f632078114..4659bbb9aa 100644 --- a/ct/qbittorrent.sh +++ b/ct/qbittorrent.sh @@ -31,9 +31,7 @@ function update_script() { msg_error "Please create new qBittorrent LXC. Updating from v4.x to v5.x is not supported!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.qbittorrent ]] || [[ "${RELEASE}" != "$(cat ~/.qbittorrent 2>/dev/null)" ]]; then + if check_for_gh_release "qbittorrent" "userdocs/qbittorrent-nox-static"; then msg_info "Stopping Service" systemctl stop qbittorrent-nox msg_ok "Stopped Service" @@ -45,10 +43,7 @@ function update_script() { msg_info "Starting Service" systemctl start qbittorrent-nox msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/radarr.sh b/ct/radarr.sh index 8a4b7e9bae..7c4cc59936 100644 --- a/ct/radarr.sh +++ b/ct/radarr.sh @@ -29,16 +29,20 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Radarr/Radarr/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ ! -f ~/.radarr ]] || [[ "$RELEASE" != "$(cat ~/.radarr 2>/dev/null)" ]]; then + if check_for_gh_release "Radarr" "Radarr/Radarr"; then + msg_info "Stopping Service" + systemctl stop radarr + msg_ok "Stopped Service" + rm -rf /opt/Radarr fetch_and_deploy_gh_release "Radarr" "Radarr/Radarr" "prebuild" "latest" "/opt/Radarr" "Radarr.master*linux-core-x64.tar.gz" chmod 775 /opt/Radarr - msg_ok "Updated successfully" - else - msg_ok "No update required. $APP is already at v${RELEASE}" - fi + msg_info "Starting Service" + systemctl start radarr + msg_ok "Started Service" + msg_ok "Updated successfully" + fi exit } diff --git a/ct/rclone.sh b/ct/rclone.sh index 79009af3c8..40afefa416 100644 --- a/ct/rclone.sh +++ b/ct/rclone.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.rclone ]] || [[ "${RELEASE}" != "$(cat ~/.rclone 2>/dev/null)" ]]; then + if check_for_gh_release "rclone" "rclone/rclone"; then msg_info "Stopping Service" systemctl stop rclone-web msg_ok "Stopped Service" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting Service" systemctl start rclone-web msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/rdtclient.sh b/ct/rdtclient.sh index 4d5c6fbfd7..90a15ec6e4 100755 --- a/ct/rdtclient.sh +++ b/ct/rdtclient.sh @@ -27,12 +27,10 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -s https://api.github.com/repos/rogerfar/rdt-client/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.rdt-client ]] || [[ "${RELEASE}" != "$(cat ~/.rdt-client 2>/dev/null)" ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "rdt-client" "rogerfar/rdt-client"; then + msg_info "Stopping Service" systemctl stop rdtc - msg_ok "Stopped ${APP}" + msg_ok "Stopped Service" msg_info "Creating backup" mkdir -p /opt/rdtc-backup @@ -46,17 +44,14 @@ function update_script() { $STD apt-get install -y dotnet-sdk-9.0 fi - msg_info "Starting ${APP}" + msg_info "Starting Service" systemctl start rdtc - msg_ok "Started ${APP}" + msg_ok "Started Service" msg_info "Cleaning Up" rm -rf /opt/rdtc-backup msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/reactive-resume.sh b/ct/reactive-resume.sh index ea10ebda3b..05afe44016 100644 --- a/ct/reactive-resume.sh +++ b/ct/reactive-resume.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No $APP Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/lazy-media/Reactive-Resume/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ ! -f "$HOME"/.reactive-resume ]] || [[ "$RELEASE" != "$(cat "$HOME"/.reactive-resume)" ]]; then + if check_for_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume"; then msg_info "Stopping services" systemctl stop Reactive-Resume msg_ok "Stopped services" @@ -38,7 +37,7 @@ function update_script() { fetch_and_deploy_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume" "tarball" "latest" "/opt/Reactive-Resume" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" cd /opt/"$APP" export PUPPETEER_SKIP_DOWNLOAD="true" export NEXT_TELEMETRY_DISABLED=1 @@ -48,7 +47,7 @@ function update_script() { $STD pnpm run build $STD pnpm run prisma:generate mv /opt/rxresume.env /opt/"$APP"/.env - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Updating Minio" systemctl stop minio @@ -84,10 +83,7 @@ function update_script() { rm -f /tmp/minio.deb rm -f "$brwsr_tmp" msg_ok "Cleanup Completed" - msg_ok "Updated Successfully" - else - msg_ok "No update required. $APP is already at v${RELEASE}" fi exit } diff --git a/ct/recyclarr.sh b/ct/recyclarr.sh index ea6606b2bd..8dbabeab44 100644 --- a/ct/recyclarr.sh +++ b/ct/recyclarr.sh @@ -27,15 +27,18 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + if check_for_gh_release "recyclarr" "recyclarr/recyclarr"; then + + msg_info "Stopping Service" + systemctl stop recyclarr + msg_ok "Stopped Service" - RELEASE=$(curl -fsSL https://api.github.com/repos/recyclarr/recyclarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.recyclarr 2>/dev/null)" ]] || [[ ! -f ~/.recyclarr ]]; then fetch_and_deploy_gh_release "recyclarr" "recyclarr/recyclarr" "prebuild" "latest" "/usr/local/bin" "recyclarr-linux-x64.tar.xz" + msg_info "Starting Service" + systemctl start recyclarr + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi - exit } diff --git a/ct/revealjs.sh b/ct/revealjs.sh index 07981e48cd..e7c97e0547 100644 --- a/ct/revealjs.sh +++ b/ct/revealjs.sh @@ -20,43 +20,39 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d "/opt/revealjs" ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/hakimel/reveal.js/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.revealjs 2>/dev/null)" ]] || [[ ! -f ~/.revealjs ]]; then - msg_info "Stopping $APP" - systemctl stop revealjs - msg_ok "Stopped $APP" - - cp /opt/revealjs/index.html /opt - fetch_and_deploy_gh_release "revealjs" "hakimel/reveal.js" "tarball" - - msg_info "Updating $APP to ${RELEASE}" - cd /opt/revealjs - $STD npm install - cp -f /opt/index.html /opt/revealjs - sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js - msg_ok "Updated $APP to ${RELEASE}" - - msg_info "Starting $APP" - systemctl start revealjs - msg_ok "Started $APP" - - msg_info "Cleaning Up" - rm -f /opt/index.html - msg_ok "Cleanup Completed" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d "/opt/revealjs" ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "revealjs" "hakimel/reveal.js"; then + msg_info "Stopping $APP" + systemctl stop revealjs + msg_ok "Stopped $APP" + + cp /opt/revealjs/index.html /opt + fetch_and_deploy_gh_release "revealjs" "hakimel/reveal.js" "tarball" + + msg_info "Updating $APP" + cd /opt/revealjs + $STD npm install + cp -f /opt/index.html /opt/revealjs + sed -i '25s/localhost/0.0.0.0/g' /opt/revealjs/gulpfile.js + msg_ok "Updated $APP" + + msg_info "Starting $APP" + systemctl start revealjs + msg_ok "Started $APP" + + msg_info "Cleaning Up" + rm -f /opt/index.html + msg_ok "Cleanup Completed" + msg_ok "Update Successful" + fi + exit } start diff --git a/ct/rustdeskserver.sh b/ct/rustdeskserver.sh index 957a76ecff..4c27d2cea7 100644 --- a/ct/rustdeskserver.sh +++ b/ct/rustdeskserver.sh @@ -28,7 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - + RELEASE=$(curl -fsSL https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') APIRELEASE=$(curl -fsSL https://api.github.com/repos/lejianwen/rustdesk-api/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') if [[ "${RELEASE}" != "$(cat ~/.rustdesk-hbbr)" ]] || [[ "${APIRELEASE}" != "$(cat ~/.rustdesk-api)" ]] || [[ ! -f ~/.rustdesk-hbbr ]] || [[ ! -f ~/.rustdesk-api ]]; then diff --git a/ct/seelf.sh b/ct/seelf.sh index 350e1a6873..8792d1569d 100644 --- a/ct/seelf.sh +++ b/ct/seelf.sh @@ -28,9 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if fetch_and_deploy_gh_release "seelf" "YuukanOO/seelf"; then - msg_ok "$APP already at the latest version. No update required." - else + if check_for_gh_release "seelf" "YuukanOO/seelf"; then msg_info "Stopping $APP" systemctl stop seelf msg_ok "Stopped $APP" @@ -43,6 +41,7 @@ function update_script() { msg_info "Starting $APP" systemctl start seelf msg_ok "Started $APP" + msg_ok "Update Successfully" fi exit } diff --git a/ct/semaphore.sh b/ct/semaphore.sh index df59fd8a8a..d24135e300 100644 --- a/ct/semaphore.sh +++ b/ct/semaphore.sh @@ -28,8 +28,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/semaphoreui/semaphore/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.semaphore ]] || [[ "${RELEASE}" != "$(cat ~/.semaphore 2>/dev/null)" ]]; then + if check_for_gh_release "semaphore" "semaphoreui/semaphore"; then msg_info "Stopping Service" systemctl stop semaphore msg_ok "Stopped Service" @@ -39,10 +38,7 @@ function update_script() { msg_info "Starting Service" systemctl start semaphore msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/silverbullet.sh b/ct/silverbullet.sh index 3d8414daf4..c33b37cb20 100644 --- a/ct/silverbullet.sh +++ b/ct/silverbullet.sh @@ -26,9 +26,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/silverbulletmd/silverbullet/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f ~/.silverbullet || "${RELEASE}" != "$(cat ~/.silverbullet 2>/dev/null)" ]]; then + + if check_for_gh_release "silverbullet" "silverbulletmd/silverbullet"; then msg_info "Stopping ${APP}" systemctl stop silverbullet msg_ok "Stopped ${APP}" @@ -38,8 +37,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start silverbullet msg_ok "Started ${APP}" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Update Successful" fi exit } diff --git a/ct/snipeit.sh b/ct/snipeit.sh index b22a74fe7a..3f93f2f70a 100644 --- a/ct/snipeit.sh +++ b/ct/snipeit.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/snipe/snipe-it/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "v([^"]+).*/\1/') - if [[ ! -f ~/.snipe-it ]] || [[ "${RELEASE}" != "$(cat ~/.snipe-it 2>/dev/null)" ]]; then + if check_for_gh_release "snipe-it" "snipe/snipe-it"; then msg_info "Stopping Services" systemctl stop nginx msg_ok "Services Stopped" @@ -43,7 +42,7 @@ function update_script() { sed -i 's/php8.2/php8.3/g' /etc/nginx/conf.d/snipeit.conf setup_composer - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" $STD apt-get update $STD apt-get -y upgrade cp /opt/snipe-it-backup/.env /opt/snipe-it/.env @@ -66,8 +65,7 @@ function update_script() { msg_info "Starting Service" systemctl start nginx msg_ok "Started Service" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Update Successful" fi exit } diff --git a/ct/stirling-pdf.sh b/ct/stirling-pdf.sh index 8daac2496b..b487e3dd57 100644 --- a/ct/stirling-pdf.sh +++ b/ct/stirling-pdf.sh @@ -27,8 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Stirling-Tools/Stirling-PDF/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.stirling-pdf 2>/dev/null)" ]] || [[ ! -f ~/.stirling-pdf ]]; then + + if check_for_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF"; then if [[ ! -f /etc/systemd/system/unoserver.service ]]; then msg_custom "⚠️ " "\e[33m" "Legacy installation detected – please recreate the container using the latest install script." exit 0 @@ -55,10 +55,7 @@ function update_script() { msg_info "Starting Services" systemctl start stirlingpdf libreoffice-listener unoserver msg_ok "Started Services" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/streamlink-webui.sh b/ct/streamlink-webui.sh index d5adc55fe6..9170ae9b4f 100644 --- a/ct/streamlink-webui.sh +++ b/ct/streamlink-webui.sh @@ -29,22 +29,17 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/CrazyWolf13/streamlink-webui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.${APP} 2>/dev/null || cat /opt/${APP}_version.txt 2>/dev/null)" ]]; then - msg_info "Starting Update" - + if check_for_gh_release "streamlink-webui" "CrazyWolf13/streamlink-webui"; then msg_info "Stopping $APP" systemctl stop ${APP} msg_ok "Stopped $APP" rm -rf /opt/${APP} - NODE_VERSION="22" - NODE_MODULE="npm,yarn" - setup_nodejs + NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs setup_uv fetch_and_deploy_gh_release "streamlink-webui" "CrazyWolf13/streamlink-webui" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" $STD uv venv /opt/"${APP}"/backend/src/.venv source /opt/"${APP}"/backend/src/.venv/bin/activate $STD uv pip install -r /opt/"${APP}"/backend/src/requirements.txt --python=/opt/"${APP}"/backend/src/.venv @@ -52,15 +47,12 @@ function update_script() { $STD yarn install $STD yarn build chmod +x /opt/"${APP}"/start.sh - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start ${APP} msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/suwayomiserver.sh b/ct/suwayomiserver.sh index 733c718030..5cd947f4a4 100644 --- a/ct/suwayomiserver.sh +++ b/ct/suwayomiserver.sh @@ -28,8 +28,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.suwayomi-server 2>/dev/null)" ]] || [[ ! -f ~/.suwayomi-server ]]; then + + if check_for_gh_release "suwayomi-server" "Suwayomi/Suwayomi-Server"; then JAVA_VERSION=21 setup_java msg_info "Stopping $APP" @@ -41,10 +41,7 @@ function update_script() { msg_info "Starting $APP" systemctl start suwayomi-server msg_ok "Started $APP" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/tandoor.sh b/ct/tandoor.sh index d7d421892c..e58c03f2d9 100644 --- a/ct/tandoor.sh +++ b/ct/tandoor.sh @@ -33,8 +33,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/TandoorRecipes/recipes/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.tandoor 2>/dev/null)" ]] || [[ ! -f ~/.tandoor ]]; then + if check_for_gh_release "tandoor" "TandoorRecipes/recipes"; then msg_info "Stopping $APP" systemctl stop tandoor msg_ok "Stopped $APP" @@ -47,7 +46,7 @@ function update_script() { PYTHON_VERSION="3.13" setup_uv fetch_and_deploy_gh_release "tandoor" "TandoorRecipes/recipes" "tarball" "latest" "/opt/tandoor" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" cp -r /opt/tandoor.bak/{config,api,mediafiles,staticfiles} /opt/tandoor/ mv /opt/tandoor.bak/.env /opt/tandoor/.env cd /opt/tandoor @@ -65,7 +64,7 @@ EOF cd /opt/tandoor $STD /opt/tandoor/.venv/bin/python manage.py migrate $STD /opt/tandoor/.venv/bin/python manage.py collectstatic --no-input - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start tandoor @@ -76,8 +75,6 @@ EOF rm -rf /opt/tandoor.bak msg_ok "Cleanup Completed" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/teddycloud.sh b/ct/teddycloud.sh index b34e8a5104..231f69ddef 100644 --- a/ct/teddycloud.sh +++ b/ct/teddycloud.sh @@ -26,9 +26,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE="$(curl -fsSL https://api.github.com/repos/toniebox-reverse-engineering/teddycloud/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')" - if [[ ! -f ~/.teddycloud || "${RELEASE}" != "$(cat ~/.teddycloud)" ]]; then + + if check_for_gh_release "teddycloud" "toniebox-reverse-engineering/teddycloud"; then msg_info "Stopping ${APP}" systemctl stop teddycloud msg_ok "Stopped ${APP}" @@ -49,11 +48,8 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/teddycloud_bak - msg_ok "Cleaned" - + msg_ok "Cleaned up" msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/the-lounge.sh b/ct/the-lounge.sh index b900a4e39a..23f144f3e2 100644 --- a/ct/the-lounge.sh +++ b/ct/the-lounge.sh @@ -28,17 +28,17 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.thelounge ]] || [[ "${RELEASE}" != "$(cat ~/.thelounge)" ]]; then + if check_for_gh_release "thelounge" "thelounge/thelounge-deb"; then msg_info "Stopping Service" systemctl stop thelounge msg_ok "Stopped Service" fetch_and_deploy_gh_release "thelounge" "thelounge/thelounge-deb" "binary" + msg_info "Starting Service" + systemctl start thelounge + msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/threadfin.sh b/ct/threadfin.sh index c45f5b61d9..410b01d903 100644 --- a/ct/threadfin.sh +++ b/ct/threadfin.sh @@ -28,9 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/threadfin/threadfin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.threadfin_version 2>/dev/null)" ]] || [[ ! -f ~/.threadfin_version ]]; then - + if check_for_gh_release "threadfin" "threadfin/threadfin"; then msg_info "Stopping $APP" systemctl stop threadfin msg_ok "Stopped $APP" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting $APP" systemctl start threadfin msg_ok "Started $APP" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" fi exit } diff --git a/ct/tianji.sh b/ct/tianji.sh index fe89839e5d..fff256ac01 100644 --- a/ct/tianji.sh +++ b/ct/tianji.sh @@ -26,14 +26,10 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! command -v jq &>/dev/null; then - $STD apt-get install -y jq - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/msgbyte/tianji/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.tianji 2>/dev/null)" ]] || [[ ! -f ~/.tianji ]]; then + setup_uv - setup_uv + if check_for_gh_release "tianji" "msgbyte/tianji"; then NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/msgbyte/tianji/master/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs msg_info "Stopping Service" @@ -76,8 +72,6 @@ function update_script() { rm -rf /opt/tianji/reporter msg_ok "Cleaned" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." fi exit } diff --git a/ct/traccar.sh b/ct/traccar.sh index c4623f3886..f007519e51 100644 --- a/ct/traccar.sh +++ b/ct/traccar.sh @@ -20,50 +20,49 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/traccar ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/traccar/traccar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.traccar)" ]] || [[ ! -f ~/.traccar ]]; then - msg_info "Stopping service" - systemctl stop traccar - msg_ok "Service stopped" - - msg_info "Creating backup" - mv /opt/traccar/conf/traccar.xml /opt - [[ -d /opt/traccar/data ]] && mv /opt/traccar/data /opt - [[ -d /opt/traccar/media ]] && mv /opt/traccar/media /opt - msg_ok "Backup created" - - rm -rf /opt/traccar - fetch_and_deploy_gh_release "traccar" "traccar/traccar" "prebuild" "latest" "/opt/traccar" "traccar-linux-64*.zip" - cd /opt/traccar - $STD ./traccar.run - - msg_info "Restoring data" - mv /opt/traccar.xml /opt/traccar/conf - [[ -d /opt/data ]] && mv /opt/data /opt/traccar - [[ -d /opt/media ]] && mv /opt/media /opt/traccar - msg_ok "Data restored" - - msg_info "Starting ${APP}" - systemctl start traccar - msg_ok "Started ${APP}" - - msg_info "Cleaning up" - [ -f README.txt ] || [ -f traccar.run ] && rm -f README.txt traccar.run - msg_ok "Cleaned up" - - msg_ok "Successfully updated ${APP}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/traccar ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "traccar" "traccar/traccar"; then + msg_info "Stopping service" + systemctl stop traccar + msg_ok "Service stopped" + + msg_info "Creating backup" + mv /opt/traccar/conf/traccar.xml /opt + [[ -d /opt/traccar/data ]] && mv /opt/traccar/data /opt + [[ -d /opt/traccar/media ]] && mv /opt/traccar/media /opt + msg_ok "Backup created" + + rm -rf /opt/traccar + fetch_and_deploy_gh_release "traccar" "traccar/traccar" "prebuild" "latest" "/opt/traccar" "traccar-linux-64*.zip" + + msg_info "Perform Update" + cd /opt/traccar + $STD ./traccar.run + msg_ok "App-Update completed" + + msg_info "Restoring data" + mv /opt/traccar.xml /opt/traccar/conf + [[ -d /opt/data ]] && mv /opt/data /opt/traccar + [[ -d /opt/media ]] && mv /opt/media /opt/traccar + msg_ok "Data restored" + + msg_info "Starting ${APP}" + systemctl start traccar + msg_ok "Started ${APP}" + + msg_info "Cleaning up" + [ -f README.txt ] || [ -f traccar.run ] && rm -f README.txt traccar.run + msg_ok "Cleaned up" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/tracktor.sh b/ct/tracktor.sh index 7a76fa6e5e..e7ec217c80 100644 --- a/ct/tracktor.sh +++ b/ct/tracktor.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/javedh-dev/tracktor/releases/latest | jq -r '.tag_name' | sed 's/^v//') - if [[ "${RELEASE}" != "$(cat ~/.tracktor 2>/dev/null)" ]] || [[ ! -f ~/.tracktor ]]; then + if check_for_gh_release "tracktor" "javedh-dev/tracktor"; then msg_info "Stopping Service" systemctl stop tracktor msg_ok "Stopped Service" @@ -40,7 +39,7 @@ function update_script() { setup_nodejs fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor" - + msg_info "Updating ${APP}" cd /opt/tracktor $STD npm install @@ -54,10 +53,7 @@ function update_script() { msg_info "Starting Service" systemctl start tracktor msg_ok "Started Service" - msg_ok "Updated Successfully" - else - msg_ok "Already up to date" fi exit } diff --git a/ct/traefik.sh b/ct/traefik.sh index a7044a7fd1..f3d441e8dd 100644 --- a/ct/traefik.sh +++ b/ct/traefik.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/traefik/traefik/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.traefik)" ]] || [[ ! -f ~/.traefik ]]; then + if check_for_gh_release "traefik" "traefik/traefik"; then msg_info "Stopping service" systemctl stop traefik msg_ok "Service stopped" @@ -39,10 +38,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start traefik msg_ok "Started ${APP}" - - msg_ok "Successfully updated ${APP}" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/trilium.sh b/ct/trilium.sh index 22461f552c..4957e97329 100644 --- a/ct/trilium.sh +++ b/ct/trilium.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/TriliumNext/Trilium/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.Trilium 2>/dev/null)" ]] || [[ ! -f ~/.Trilium ]]; then - + if check_for_gh_release "Trilium" "TriliumNext/Trilium"; then if [[ -d /opt/trilium/db ]]; then DB_PATH="/opt/trilium/db" DB_RESTORE_PATH="/opt/trilium/db" @@ -68,10 +66,7 @@ function update_script() { sleep 1 msg_ok "Started ${APP}" msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi - exit } diff --git a/ct/tududi.sh b/ct/tududi.sh index f144fe167d..9abb44b520 100644 --- a/ct/tududi.sh +++ b/ct/tududi.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/chrisvel/tududi/releases/latest | yq '.tag_name' | sed 's/^"v//;s/"$//') - if [[ "${RELEASE}" != "$(cat ~/.tududi 2>/dev/null)" ]] || [[ ! -f ~/.tududi ]]; then + if check_for_gh_release "tududi" "chrisvel/tududi"; then msg_info "Stopping Service" systemctl stop tududi msg_ok "Stopped Service" @@ -56,8 +54,6 @@ function update_script() { systemctl start tududi msg_ok "Started Service" msg_ok "Updated Successfully" - else - msg_ok "Already up to date" fi exit } diff --git a/ct/typesense.sh b/ct/typesense.sh index a3baa8cb33..0d5aecc4c3 100644 --- a/ct/typesense.sh +++ b/ct/typesense.sh @@ -20,23 +20,20 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/typesense/typesense-server.ini ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/typesense/typesense/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Updating ${APP} LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/typesense/typesense-server.ini ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + if check_for_gh_release "typesense" "typesense/typesense"; then + msg_info "Updating ${APP} LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated Successfully" + fi + exit } start @@ -46,4 +43,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following IP:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}${IP}:8108${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}${IP}:8108${CL}" diff --git a/ct/umami.sh b/ct/umami.sh index 54b69aaebf..8610ead527 100644 --- a/ct/umami.sh +++ b/ct/umami.sh @@ -20,14 +20,15 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/umami ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/umami ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + if check_for_gh_release "umami" "umami-software/umami"; then msg_info "Stopping ${APP}" systemctl stop umami msg_ok "Stopped $APP" @@ -43,9 +44,9 @@ function update_script() { msg_info "Starting ${APP}" systemctl start umami msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - exit + fi + exit } start diff --git a/ct/uptimekuma.sh b/ct/uptimekuma.sh index d2a8714e60..2b7b644660 100644 --- a/ct/uptimekuma.sh +++ b/ct/uptimekuma.sh @@ -27,35 +27,26 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then - if ! command -v npm >/dev/null 2>&1; then - echo "Installing NPM..." - $STD apt-get install -y npm - echo "Installed NPM..." - fi - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/louislam/uptime-kuma/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') - if [[ ! -f ~/.uptime-kuma ]] || [[ "${RELEASE}" != "$(cat ~/.uptime-kuma)" ]]; then + NODE_VERSION="22" setup_nodejs + + if check_for_gh_release "uptime-kuma" "louislam/uptime-kuma"; then msg_info "Stopping ${APP}" - $STD systemctl stop uptime-kuma + systemctl stop uptime-kuma msg_ok "Stopped ${APP}" fetch_and_deploy_gh_release "uptime-kuma" "louislam/uptime-kuma" "tarball" - cd /opt/uptime-kuma - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" + cd /opt/uptime-kuma $STD npm install --omit dev $STD npm run download-dist msg_ok "Updated ${APP}" msg_info "Starting ${APP}" - $STD sudo systemctl start uptime-kuma + systemctl start uptime-kuma msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/victoriametrics.sh b/ct/victoriametrics.sh index fda7f0ecb4..d6eac1dac6 100644 --- a/ct/victoriametrics.sh +++ b/ct/victoriametrics.sh @@ -27,9 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/VictoriaMetrics/VictoriaMetrics/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.victoriametrics ]] || [[ "${RELEASE}" != "$(cat ~/.victoriametrics)" ]]; then + + if check_for_gh_release "victoriametrics" "VictoriaMetrics/VictoriaMetrics"; then msg_info "Stopping $APP" systemctl stop victoriametrics [[ -f /etc/systemd/system/victoriametrics-logs.service ]] && systemctl stop victoriametrics-logs @@ -55,10 +54,7 @@ function update_script() { systemctl start victoriametrics [[ -f /etc/systemd/system/victoriametrics-logs.service ]] && systemctl start victoriametrics-logs msg_ok "Started $APP" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/wallos.sh b/ct/wallos.sh index 4166494a73..387b8f9fc6 100644 --- a/ct/wallos.sh +++ b/ct/wallos.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.wallos ]] || [[ "${RELEASE}" != "$(cat ~/.wallos)" ]]; then + if check_for_gh_release "wallos" "ellite/Wallos"; then msg_info "Creating backup" mkdir -p /opt/logos mv /opt/wallos/db/wallos.db /opt/wallos.db @@ -44,7 +43,7 @@ function update_script() { mv /opt/wallos.db /opt/wallos/db/wallos.db mv /opt/logos/* /opt/wallos/images/uploads/logos if ! grep -q "storetotalyearlycost.php" /opt/wallos.cron; then - echo "30 1 * * 1 php /opt/wallos/endpoints/cronjobs/storetotalyearlycost.php >> /var/log/cron/storetotalyearlycost.log 2>&1" >> /opt/wallos.cron + echo "30 1 * * 1 php /opt/wallos/endpoints/cronjobs/storetotalyearlycost.php >> /var/log/cron/storetotalyearlycost.log 2>&1" >>/opt/wallos.cron fi chown -R www-data:www-data /opt/wallos chmod -R 755 /opt/wallos @@ -55,10 +54,7 @@ function update_script() { msg_info "Reload Apache2" systemctl reload apache2 msg_ok "Apache2 Reloaded" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/watcharr.sh b/ct/watcharr.sh index a4d0d8eaf3..2bf0a1b54c 100644 --- a/ct/watcharr.sh +++ b/ct/watcharr.sh @@ -20,46 +20,40 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/watcharr ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/sbondCo/Watcharr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.watcharr)" ]] || [[ ! -f ~/.watcharr ]]; then - msg_info "Updating $APP" - - msg_info "Stopping $APP" - systemctl stop watcharr - msg_ok "Stopped $APP" - - rm -f /opt/watcharr/server/watcharr - rm -rf /opt/watcharr/server/ui - fetch_and_deploy_gh_release "watcharr" "sbondCo/Watcharr" "tarball" - - msg_info "Updating $APP to v${RELEASE}" - cd /opt/watcharr - export GOOS=linux - $STD npm i - $STD npm run build - mv ./build ./server/ui - cd server - go mod download - go build -o ./watcharr - msg_ok "Updated $APP to v${RELEASE}" - - msg_info "Starting $APP" - systemctl start watcharr - msg_ok "Started $APP" - - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/watcharr ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "watcharr" "sbondCo/Watcharr"; then + msg_info "Stopping $APP" + systemctl stop watcharr + msg_ok "Stopped $APP" + + rm -f /opt/watcharr/server/watcharr + rm -rf /opt/watcharr/server/ui + fetch_and_deploy_gh_release "watcharr" "sbondCo/Watcharr" "tarball" + + msg_info "Updating $APP" + cd /opt/watcharr + export GOOS=linux + $STD npm i + $STD npm run build + mv ./build ./server/ui + cd server + $STD go mod download + $STD go build -o ./watcharr + msg_ok "Updated $APP" + + msg_info "Starting $APP" + systemctl start watcharr + msg_ok "Started $APP" + msg_ok "Update Successfully" + fi + exit } start diff --git a/ct/watchyourlan.sh b/ct/watchyourlan.sh index 0be6e8ef82..e4401908c2 100644 --- a/ct/watchyourlan.sh +++ b/ct/watchyourlan.sh @@ -20,36 +20,34 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /lib/systemd/system/watchyourlan.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Stopping service" - systemctl stop watchyourlan.service - msg_ok "Service stopped" - - cp -R /data/config.yaml ~/config.yaml - fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary" - cp -R config.yaml /data/config.yaml - sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service - - msg_info "Cleaning up" - rm ~/config.yaml - msg_ok "Cleaned up" - - msg_info "Starting service" - systemctl enable -q --now watchyourlan - msg_ok "Service started" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /lib/systemd/system/watchyourlan.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "watchyourlan" "aceberg/WatchYourLAN"; then + msg_info "Stopping service" + systemctl stop watchyourlan.service + msg_ok "Service stopped" + + cp -R /data/config.yaml ~/config.yaml + fetch_and_deploy_gh_release "watchyourlan" "aceberg/WatchYourLAN" "binary" + cp -R config.yaml /data/config.yaml + sed -i 's|/etc/watchyourlan/config.yaml|/data/config.yaml|' /lib/systemd/system/watchyourlan.service + + msg_info "Cleaning up" + rm ~/config.yaml + msg_ok "Cleaned up" + + msg_info "Starting service" + systemctl enable -q --now watchyourlan + msg_ok "Service started" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/wavelog.sh b/ct/wavelog.sh index 01777f9344..0d677ba12c 100644 --- a/ct/wavelog.sh +++ b/ct/wavelog.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/wavelog/wavelog/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') - if [[ ! -f ~/.wavelog ]] || [[ "${RELEASE}" != "$(cat ~/.wavelog)" ]]; then + if check_for_gh_release "wavelog" "wavelog/wavelog"; then msg_info "Stopping Services" systemctl stop apache2 msg_ok "Services Stopped" @@ -46,7 +45,7 @@ function update_script() { rm -rf /opt/wavelog fetch_and_deploy_gh_release "wavelog" "wavelog/wavelog" "tarball" - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" rm -rf /opt/wavelog/install mv /opt/config.php /opt/wavelog/application/config/config.php mv /opt/database.php /opt/wavelog/application/config/database.php @@ -63,10 +62,7 @@ function update_script() { msg_info "Starting Services" systemctl start apache2 msg_ok "Started Services" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/wikijs.sh b/ct/wikijs.sh index a3464446e8..1864ad7730 100644 --- a/ct/wikijs.sh +++ b/ct/wikijs.sh @@ -20,55 +20,51 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/wikijs ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Requarks/wiki/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.wikijs)" ]] || [[ ! -f ~/.wikijs ]]; then - msg_info "Verifying whether ${APP}' new release is v3.x+ and current install uses SQLite." - SQLITE_INSTALL=$([ -f /opt/wikijs/db.sqlite ] && echo "true" || echo "false") - if [[ "${SQLITE_INSTALL}" == "true" && "${RELEASE}" =~ ^3.* ]]; then - echo "SQLite is not supported in v3.x+, currently there is no update path availble." - exit - fi - msg_ok "There is an update path available for ${APP} to v${RELEASE}" - - msg_info "Stopping ${APP}" - systemctl stop wikijs - msg_ok "Stopped ${APP}" - - msg_info "Backing up Data" - mkdir /opt/wikijs-backup - $SQLITE_INSTALL && cp /opt/wikijs/db.sqlite /opt/wikijs-backup - cp -R /opt/wikijs/{config.yml,/data} /opt/wikijs-backup - msg_ok "Backed up Data" - - rm -rf /opt/wikijs/* - fetch_and_deploy_gh_release "wikijs" "requarks/wiki" "prebuild" "latest" "/opt/wikijs" "wiki-js.tar.gz" - - msg_info "Restoring Data" - cp -R /opt/wikijs-backup/* /opt/wikijs - $SQLITE_INSTALL && $STD npm rebuild sqlite3 - msg_ok "Restored Data" - - msg_info "Starting ${APP}" - systemctl start wikijs - msg_ok "Started ${APP}" - - msg_info "Cleaning Up" - rm -rf /opt/wikijs-backup - msg_ok "Cleanup Completed" - - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/wikijs ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "wikijs" "requarks/wiki"; then + msg_info "Verifying whether ${APP}' new release is v3.x+ and current install uses SQLite." + SQLITE_INSTALL=$([ -f /opt/wikijs/db.sqlite ] && echo "true" || echo "false") + if [[ "${SQLITE_INSTALL}" == "true" && "${CHECK_UPDATE_RELEASE}" =~ ^3.* ]]; then + echo "SQLite is not supported in v3.x+, currently there is no update path availble." + exit + fi + msg_ok "There is an update path available for ${APP}" + + msg_info "Stopping ${APP}" + systemctl stop wikijs + msg_ok "Stopped ${APP}" + + msg_info "Backing up Data" + mkdir /opt/wikijs-backup + $SQLITE_INSTALL && cp /opt/wikijs/db.sqlite /opt/wikijs-backup + cp -R /opt/wikijs/{config.yml,/data} /opt/wikijs-backup + msg_ok "Backed up Data" + + rm -rf /opt/wikijs/* + fetch_and_deploy_gh_release "wikijs" "requarks/wiki" "prebuild" "latest" "/opt/wikijs" "wiki-js.tar.gz" + + msg_info "Restoring Data" + cp -R /opt/wikijs-backup/* /opt/wikijs + $SQLITE_INSTALL && $STD npm rebuild sqlite3 + msg_ok "Restored Data" + + msg_info "Starting ${APP}" + systemctl start wikijs + msg_ok "Started ${APP}" + + msg_info "Cleaning Up" + rm -rf /opt/wikijs-backup + msg_ok "Cleanup Completed" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/wizarr.sh b/ct/wizarr.sh index 178aa68ca5..68fc8d3ad9 100644 --- a/ct/wizarr.sh +++ b/ct/wizarr.sh @@ -29,8 +29,9 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/wizarrrr/wizarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.wizarr 2>/dev/null)" ]] || [[ ! -f ~/.wizarr ]]; then + setup_uv + + if check_for_gh_release "wizarr" "wizarrrr/wizarr"; then msg_info "Stopping $APP" systemctl stop wizarr msg_ok "Stopped $APP" @@ -40,10 +41,9 @@ function update_script() { $STD tar -czf "$BACKUP_FILE" /opt/wizarr/{.env,start.sh} /opt/wizarr/database/ &>/dev/null msg_ok "Backup Created" - setup_uv fetch_and_deploy_gh_release "wizarr" "wizarrrr/wizarr" - msg_info "Updating $APP to v${RELEASE}" + msg_info "Updating $APP" cd /opt/wizarr /usr/local/bin/uv -q sync --locked $STD /usr/local/bin/uv -q run pybabel compile -d app/translations @@ -52,7 +52,7 @@ function update_script() { mkdir -p ./.cache $STD tar -xf "$BACKUP_FILE" --directory=/ $STD /usr/local/bin/uv -q run flask db upgrade - msg_ok "Updated $APP to v${RELEASE}" + msg_ok "Updated $APP" msg_info "Starting $APP" systemctl start wizarr @@ -61,9 +61,7 @@ function update_script() { msg_info "Cleaning Up" rm -rf "$BACKUP_FILE" msg_ok "Cleanup Completed" - msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "Update Successfully" fi exit } diff --git a/ct/yt-dlp-webui.sh b/ct/yt-dlp-webui.sh index 0b0e8d0bbc..a2112d0fa4 100644 --- a/ct/yt-dlp-webui.sh +++ b/ct/yt-dlp-webui.sh @@ -20,36 +20,32 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /usr/local/bin/yt-dlp-webui ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + header_info + check_container_storage + check_container_resources + if [[ ! -f /usr/local/bin/yt-dlp-webui ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + if check_for_gh_release "yt-dlp-webui" "marcopiovanello/yt-dlp-web-ui"; then + msg_info "Stopping $APP" + systemctl stop yt-dlp-webui + msg_ok "Stopped $APP" - RELEASE=$(curl -fsSL https://api.github.com/repos/marcopiovanello/yt-dlp-web-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ "${RELEASE}" != "$(cat ~/.yt-dlp-webui)" ]] || [[ ! -f ~/.yt-dlp-webui ]]; then + msg_info "Updating yt-dlp" + $STD yt-dlp -U + msg_ok "Updated yt-dlp" - msg_info "Stopping $APP" - systemctl stop yt-dlp-webui - msg_ok "Stopped $APP" + rm -rf /usr/local/bin/yt-dlp-webui + fetch_and_deploy_gh_release "yt-dlp-webui" "marcopiovanello/yt-dlp-web-ui" "singlefile" "latest" "/usr/local/bin" "yt-dlp-webui_linux-amd64" - msg_info "Updating yt-dlp" - $STD yt-dlp -U - msg_ok "Updated yt-dlp" - - rm -rf /usr/local/bin/yt-dlp-webui - fetch_and_deploy_gh_release "yt-dlp-webui" "marcopiovanello/yt-dlp-web-ui" "singlefile" "latest" "/usr/local/bin" "yt-dlp-webui_linux-amd64" - - msg_info "Starting $APP" - systemctl start yt-dlp-webui - msg_ok "Started $APP" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi - exit + msg_info "Starting $APP" + systemctl start yt-dlp-webui + msg_ok "Started $APP" + msg_ok "Updated Successfully" + fi + exit } start diff --git a/ct/zigbee2mqtt.sh b/ct/zigbee2mqtt.sh index b40a3c34f8..4a76a8da83 100644 --- a/ct/zigbee2mqtt.sh +++ b/ct/zigbee2mqtt.sh @@ -28,21 +28,7 @@ function update_script() { exit fi - if [[ -f ~/.zigbee2mqtt ]]; then - CURRENT="$(cat ~/.zigbee2mqtt)" - elif [[ -f /opt/${APP}_version.txt ]]; then - CURRENT="$(cat /opt/${APP}_version.txt)" - rm -f /opt/${APP}_version.txt - else - CURRENT="" - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "$RELEASE" != "$CURRENT" ]]; then - if ! command -v jq &>/dev/null; then - $STD apt-get update - $STD apt-get install -y jq - fi + if check_for_gh_release "Zigbee2MQTT" "Koenkk/zigbee2mqtt"; then NODE_VERSION=24 NODE_MODULE="pnpm@$(curl -fsSL https://raw.githubusercontent.com/Koenkk/zigbee2mqtt/master/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs msg_info "Stopping Service" @@ -58,7 +44,7 @@ function update_script() { fetch_and_deploy_gh_release "Zigbee2MQTT" "Koenkk/zigbee2mqtt" "tarball" "latest" "/opt/zigbee2mqtt" - msg_info "Updating ${APP} to v${RELEASE}" + msg_info "Updating ${APP}" rm -rf /opt/zigbee2mqtt/data mv /opt/z2m_backup/data /opt/zigbee2mqtt cd /opt/zigbee2mqtt @@ -73,8 +59,7 @@ function update_script() { msg_info "Cleaning up" rm -rf /opt/z2m_backup msg_ok "Cleaned up" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}." + msg_ok "Updated Successfully" fi exit } diff --git a/ct/zipline.sh b/ct/zipline.sh index fa1c564904..8aac7c5f2f 100644 --- a/ct/zipline.sh +++ b/ct/zipline.sh @@ -33,11 +33,10 @@ function update_script() { msg_ok "Installed pnpm" fi - RELEASE=$(curl -fsSL https://api.github.com/repos/diced/zipline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.zipline ]] || [[ "${RELEASE}" != "$(cat ~/.zipline)" ]]; then - msg_info "Stopping ${APP}" + if check_for_gh_release "zipline" "diced/zipline"; then + msg_info "Stopping Service" systemctl stop zipline - msg_ok "${APP} Stopped" + msg_ok "Service Stopped" mkdir -p /opt/zipline-uploads if [ -d /opt/zipline/uploads ] && [ "$(ls -A /opt/zipline/uploads)" ]; then @@ -47,7 +46,7 @@ function update_script() { rm -R /opt/zipline fetch_and_deploy_gh_release "zipline" "diced/zipline" "tarball" - msg_info "Updating ${APP} to ${RELEASE}" + msg_info "Updating ${APP}" cd /opt/zipline mv /opt/.env /opt/zipline/.env $STD pnpm install @@ -57,10 +56,7 @@ function update_script() { msg_info "Starting ${APP}" systemctl start zipline msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/zitadel.sh b/ct/zitadel.sh index fac6801594..3255cc6cb9 100644 --- a/ct/zitadel.sh +++ b/ct/zitadel.sh @@ -28,26 +28,22 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/zitadel/zitadel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.zitadel ]] || [[ "${RELEASE}" != "$(cat ~/.zitadel)" ]]; then - msg_info "Stopping $APP" + if check_for_gh_release "zitadel" "zitadel/zitadel"; then + msg_info "Stopping Service" systemctl stop zitadel - msg_ok "Stopped $APP" + msg_ok "Stopped Service" rm -f /usr/local/bin/zitadel fetch_and_deploy_gh_release "zitadel" "zitadel/zitadel" "prebuild" "latest" "/usr/local/bin" "zitadel-linux-amd64.tar.gz" - msg_info "Updating $APP to ${RELEASE}" + msg_info "Updating $APP" $STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true - msg_ok "Updated $APP to ${RELEASE}" + msg_ok "Updated $APP" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start zitadel - msg_ok "Started $APP" - + msg_ok "Started Service" msg_ok "Update Successful" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/zoraxy.sh b/ct/zoraxy.sh index 78db18403f..500798526b 100644 --- a/ct/zoraxy.sh +++ b/ct/zoraxy.sh @@ -27,9 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.zoraxy ]] || [[ "${RELEASE}" != "$(cat ~/.zoraxy)" ]]; then + if check_for_gh_release "zoraxy" "tobychui/zoraxy"; then msg_info "Stopping service" systemctl stop zoraxy msg_ok "Service stopped" @@ -40,10 +38,7 @@ function update_script() { msg_info "Starting service" systemctl start zoraxy msg_ok "Service started" - msg_ok "Updated successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit } diff --git a/ct/zot-registry.sh b/ct/zot-registry.sh index 29ce1c992b..381dfc289c 100644 --- a/ct/zot-registry.sh +++ b/ct/zot-registry.sh @@ -28,8 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') - if [[ ! -f ~/.${APP} ]] || [[ "${RELEASE}" != "$(cat ~/.${APP})" ]]; then + if check_for_gh_release "zot" "project-zot/zot"; then msg_info "Stopping Zot service" systemctl stop zot msg_ok "Stopped Zot service" @@ -44,12 +43,8 @@ function update_script() { msg_info "Starting service" systemctl start zot msg_ok "Service started" - - msg_ok "Updated successfuly" - else - msg_ok "Zot is already up to date (${RELEASE})" + msg_ok "Updated successfully" fi - exit } diff --git a/ct/zwave-js-ui.sh b/ct/zwave-js-ui.sh index d1efe2a97f..eef1c3c6dd 100644 --- a/ct/zwave-js-ui.sh +++ b/ct/zwave-js-ui.sh @@ -27,9 +27,8 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - if [[ ! -f ~/.zwave-js-ui ]] || [[ "${RELEASE}" != "$(cat ~/.zwave-js-ui)" ]]; then + + if check_for_gh_release "zwave-js-ui" "zwave-js/zwave-js-ui"; then msg_info "Stopping Service" systemctl stop zwave-js-ui msg_ok "Stopped Service" @@ -44,10 +43,7 @@ function update_script() { msg_info "Cleanup" rm -rf /opt/zwave-js-ui/store msg_ok "Cleaned" - - msg_ok "Updated Successfully!\n" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}." + msg_ok "Updated Successfully" fi exit } diff --git a/install/kometa-install.sh b/install/kometa-install.sh index 49ea5ba0fc..09702a49b4 100644 --- a/install/kometa-install.sh +++ b/install/kometa-install.sh @@ -14,7 +14,6 @@ network_check update_os PYTHON_VERSION="3.12" setup_uv -$STD uv python update-shell fetch_and_deploy_gh_release "kometa" "Kometa-Team/Kometa" msg_info "Setup Kometa"