diff --git a/ct/dashy.sh b/ct/dashy.sh index da6fac44c..e49603004 100644 --- a/ct/dashy.sh +++ b/ct/dashy.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-6}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -41,28 +41,24 @@ function update_script() { fi msg_ok "Backed up conf.yml" - rm -rf /opt/dashy - fetch_and_deploy_gh_release "dashy" "Lissy93/dashy" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "dashy" "Lissy93/dashy" - msg_info "Updating ${APP}" + msg_info "Updating Dashy" cd /opt/dashy npm install npm run build - msg_ok "Updated ${APP}" + msg_ok "Updated Dashy" msg_info "Restoring conf.yml" cd ~ cp -R conf.yml /opt/dashy/user-data + rm -rf conf.yml /opt/dashy/public/conf.yml msg_ok "Restored conf.yml" - msg_info "Cleaning" - rm -rf conf.yml /opt/dashy/public/conf.yml - msg_ok "Cleaned" - - msg_info "Starting Dashy" + msg_info "Starting Service" systemctl start dashy - msg_ok "Started Dashy" - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/dockge.sh b/ct/dockge.sh index 02a3a3c14..afd8e0730 100644 --- a/ct/dockge.sh +++ b/ct/dockge.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-18}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,19 +20,20 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/dockge ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP}" - cd /opt/dockge - docker compose pull - docker compose up -d - msg_ok "Updated ${APP}" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/dockge ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating Dockge" + cd /opt/dockge + $STD docker compose pull + $STD docker compose up -d + msg_ok "Updated Dockge" + msg_ok "Updated successfully" + exit } start @@ -42,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 URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5001${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5001${CL}" diff --git a/ct/docmost.sh b/ct/docmost.sh index d1d45462a..997b476da 100644 --- a/ct/docmost.sh +++ b/ct/docmost.sh @@ -12,6 +12,7 @@ var_ram="${var_ram:-4096}" var_disk="${var_disk:-8}" var_os="${var_os:-debian}" var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" header_info "$APP" variables @@ -44,18 +45,18 @@ function update_script() { fetch_and_deploy_gh_release "docmost" "docmost/docmost" - msg_info "Updating ${APP}" + msg_info "Updating Docmost" cd /opt/docmost mv /opt/.env /opt/docmost/.env mv /opt/data /opt/docmost/data $STD pnpm install --force $STD pnpm build - msg_ok "Updated ${APP}" + msg_ok "Updated Docmost" msg_info "Starting Service" systemctl start docmost msg_ok "Started Service" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" fi exit } diff --git a/ct/dolibarr.sh b/ct/dolibarr.sh index 15a4daa24..8f197e174 100644 --- a/ct/dolibarr.sh +++ b/ct/dolibarr.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-6}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,15 +20,15 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /usr/share/dolibarr ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_error "To update ${APP}, use the applications web interface." + header_info + check_container_storage + check_container_resources + if [[ ! -d /usr/share/dolibarr ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_error "To update ${APP}, use the applications web interface." + exit } start @@ -38,4 +38,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 URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/dolibarr/install${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/dolibarr/install${CL}" diff --git a/ct/dotnetaspwebapi.sh b/ct/dotnetaspwebapi.sh index a25b1bba5..86f08e6a6 100644 --- a/ct/dotnetaspwebapi.sh +++ b/ct/dotnetaspwebapi.sh @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /var/www ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -d /var/www ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating ${APP} LXC" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Successfully" + exit } start @@ -41,4 +41,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}:80${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}${IP}:80${CL}" diff --git a/ct/duplicati.sh b/ct/duplicati.sh index ed0baf69a..86968dac6 100644 --- a/ct/duplicati.sh +++ b/ct/duplicati.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,16 +29,16 @@ function update_script() { fi if check_for_gh_release "duplicati" "duplicati/duplicati"; then - msg_info "Stopping $APP" + msg_info "Stopping Service" systemctl stop duplicati - msg_ok "Stopped $APP" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "duplicati" "duplicati/duplicati" "binary" "latest" "/opt/duplicati" "duplicati-*-linux-x64-gui.deb" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start duplicati - msg_ok "Started $APP" - msg_ok "Update Successful" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/emqx.sh b/ct/emqx.sh index 9b0a0bd99..eca15171d 100644 --- a/ct/emqx.sh +++ b/ct/emqx.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -32,9 +32,9 @@ function update_script() { msg_info "Removing old EMQX" if dpkg -l | grep -q "^ii\s\+emqx\s"; then - $STD apt-get remove --purge -y emqx + $STD apt remove --purge -y emqx elif dpkg -l | grep -q "^ii\s\+emqx-enterprise\s"; then - $STD apt-get remove --purge -y emqx-enterprise + $STD apt remove --purge -y emqx-enterprise else msg_ok "No old EMQX package found" fi @@ -46,18 +46,15 @@ function update_script() { msg_ok "Downloaded EMQX" msg_info "Installing EMQX" - $STD apt-get install -y "$DEB_FILE" + $STD apt install -y "$DEB_FILE" + echo "$RELEASE" >~/.emqx + rm -f "$DEB_FILE" msg_ok "Installed EMQX v${RELEASE}" - msg_info "Starting EMQX" + msg_info "Starting Service" systemctl start emqx - echo "$RELEASE" >~/.emqx - msg_ok "Started EMQX" - - msg_info "Cleaning Up" - rm -f "$DEB_FILE" - msg_ok "Cleanup Completed" - msg_ok "Update Successful" + msg_ok "Started Service" + msg_ok "Updated successfully" else msg_ok "No update required. EMQX is already at v${RELEASE}" fi diff --git a/ct/ersatztv.sh b/ct/ersatztv.sh index 7ccd2fb35..693224b79 100644 --- a/ct/ersatztv.sh +++ b/ct/ersatztv.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-5}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -27,23 +27,22 @@ function update_script() { exit fi if check_for_gh_release "ersatztv" "ErsatzTV/ErsatzTV"; then - msg_info "Stopping ErsatzTV" + msg_info "Stopping Service" systemctl stop ersatzTV - msg_ok "Stopped ErsatzTV" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "ersatztv" "ErsatzTV/ErsatzTV" "prebuild" "latest" "/opt/ErsatzTV" "*linux-x64.tar.gz" - msg_info "Starting ErsatzTV" + msg_info "Starting Service" systemctl start ersatzTV - msg_ok "Started ErsatzTV" - - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "ErsatzTV Updated successfully" fi if check_for_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg"; then - msg_info "Stopping ErsatzTV" + msg_info "Stopping Service" systemctl stop ersatzTV - msg_ok "Stopped ErsatzTV" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz" @@ -54,10 +53,10 @@ function update_script() { ln -sf /opt/ErsatzTV-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe msg_ok "ffmpeg links set" - msg_info "Starting ErsatzTV" + msg_info "Starting Service" systemctl start ersatzTV - msg_ok "Started ErsatzTV" - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "ErsatzTV-ffmpeg Updated successfully" fi exit } diff --git a/ct/esphome.sh b/ct/esphome.sh index f9d991017..ea8a19965 100644 --- a/ct/esphome.sh +++ b/ct/esphome.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -81,7 +81,7 @@ EOF msg_info "Starting Service" systemctl start esphomeDashboard msg_ok "Started Service" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" exit } diff --git a/ct/evcc.sh b/ct/evcc.sh index d38659222..f3de7bf48 100644 --- a/ct/evcc.sh +++ b/ct/evcc.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -23,14 +23,23 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -f /etc/apt/sources.list.d/evcc-stable.list ]]; then + if ! command -v evcc >/dev/null 2>&1; then msg_error "No ${APP} Installation Found!" - exit + exit 1 + fi + + if [[ -f /etc/apt/sources.list.d/evcc-stable.list ]]; then + setup_deb822_repo \ + "evcc-stable" \ + "https://dl.evcc.io/public/evcc/stable/gpg.EAD5D0E07B0EC0FD.key" \ + "https://dl.evcc.io/public/evcc/stable/deb/debian/" \ + "$(get_os_info codename)" \ + "main" fi msg_info "Updating evcc LXC" $STD apt update $STD apt --only-upgrade install -y evcc - msg_ok "Updated Successfully" + msg_ok "Updated successfully!" exit } @@ -41,4 +50,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 URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7070${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7070${CL}" diff --git a/ct/excalidraw.sh b/ct/excalidraw.sh index 2fdc5f0cf..cc5447d0f 100644 --- a/ct/excalidraw.sh +++ b/ct/excalidraw.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-3072}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,22 +29,22 @@ function update_script() { exit fi if check_for_gh_release "excalidraw" "excalidraw/excalidraw"; then - msg_info "Stopping $APP" + msg_info "Stopping Service" systemctl stop excalidraw - msg_ok "Stopped $APP" + msg_ok "Stopped Service" rm -rf /opt/excalidraw fetch_and_deploy_gh_release "excalidraw" "excalidraw/excalidraw" - msg_info "Updating $APP" + msg_info "Updating Excalidraw" cd /opt/excalidraw $STD yarn - msg_ok "Updated $APP" + msg_ok "Updated Excalidraw" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start excalidraw - msg_ok "Started $APP" - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/fhem.sh b/ct/fhem.sh index f64c87e20..5575f29b4 100644 --- a/ct/fhem.sh +++ b/ct/fhem.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-8}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/fhem.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/fhem.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating ${APP} LXC" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Successfully" + exit } start @@ -41,4 +41,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 URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8083${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8083${CL}" diff --git a/ct/fileflows.sh b/ct/fileflows.sh index 714d93e8e..555910949 100644 --- a/ct/fileflows.sh +++ b/ct/fileflows.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-8}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -28,42 +28,36 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if ! [[ $(dpkg -s jq 2>/dev/null) ]]; then - $STD apt-get update - $STD apt-get install -y jq - fi update_available=$(curl -fsSL -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' | jq .UpdateAvailable) if [[ "${update_available}" == "true" ]]; then - msg_info "Stopping $APP" + msg_info "Stopping Service" systemctl stop fileflows - msg_ok "Stopped $APP" + msg_ok "Stopped Service" msg_info "Creating Backup" backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz" tar -czf "$backup_filename" -C /opt/fileflows Data msg_ok "Backup Created" - msg_info "Updating $APP to latest version" + msg_info "Updating FileFlows" temp_file=$(mktemp) curl -fsSL https://fileflows.com/downloads/zip -o "$temp_file" $STD unzip -o -d /opt/fileflows "$temp_file" - msg_ok "Updated $APP to latest version" + msg_ok "Updated FileFlows" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start fileflows - msg_ok "Started $APP" + msg_ok "Started Service" msg_info "Cleaning Up" rm -rf "$temp_file" rm -rf "$backup_filename" msg_ok "Cleanup Completed" - - msg_ok "Update Successful" + msg_ok "Updated successfully" else msg_ok "No update required. ${APP} is already at latest version" fi - exit } diff --git a/ct/firefly.sh b/ct/firefly.sh index acfb29fcc..6482c508f 100644 --- a/ct/firefly.sh +++ b/ct/firefly.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -41,7 +41,7 @@ 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}" + msg_info "Updating Firefly" rm -rf /opt/firefly/storage cp /opt/.env /opt/firefly/.env cp -r /opt/storage /opt/firefly/storage @@ -57,12 +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}" + msg_ok "Updated Firefly" msg_info "Starting Apache2" systemctl start apache2 msg_ok "Started Apache2" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" fi exit } diff --git a/ct/flaresolverr.sh b/ct/flaresolverr.sh index bc5720f82..44e4ec1f0 100644 --- a/ct/flaresolverr.sh +++ b/ct/flaresolverr.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -28,17 +28,17 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - if check_for_gh_release "flaresolverr" "FlareSolverr/FlareSolverr" "3.3.25"; then - msg_info "Stopping service" + if check_for_gh_release "flaresolverr" "FlareSolverr/FlareSolverr"; then + msg_info "Stopping Service" systemctl stop flaresolverr - msg_ok "Stopped service" + msg_ok "Stopped Service" - rm -rf /opt/flaresolverr - fetch_and_deploy_gh_release "flaresolverr" "FlareSolverr/FlareSolverr" "prebuild" "v3.3.25" "/opt/flaresolverr" "flaresolverr_linux_x64.tar.gz" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "flaresolverr" "FlareSolverr/FlareSolverr" "prebuild" "latest" "/opt/flaresolverr" "flaresolverr_linux_x64.tar.gz" - msg_info "Starting service" + msg_info "Starting Service" systemctl start flaresolverr - msg_ok "Started service" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/flowiseai.sh b/ct/flowiseai.sh index 7e93499a6..94d5931ce 100644 --- a/ct/flowiseai.sh +++ b/ct/flowiseai.sh @@ -11,7 +11,7 @@ var_disk="${var_disk:-10}" var_cpu="${var_cpu:-4}" var_ram="${var_ram:-4096}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,19 +20,19 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/flowise.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP}" - systemctl stop flowise - npm install -g flowise --upgrade - systemctl start flowise - msg_ok "Updated ${APP}" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/systemd/system/flowise.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating FlowiseAI" + systemctl stop flowise + npm install -g flowise --upgrade + systemctl start flowise + msg_ok "Updated FlowiseAI" + exit } start @@ -42,4 +42,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 URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/ct/fluid-calendar.sh b/ct/fluid-calendar.sh index 42f4c3c83..c52c80544 100644 --- a/ct/fluid-calendar.sh +++ b/ct/fluid-calendar.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-3}" var_ram="${var_ram:-4096}" var_disk="${var_disk:-7}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,15 +29,14 @@ function update_script() { exit fi if check_for_gh_release "fluid-calendar" "dotnetfactory/fluid-calendar"; then - msg_info "Stopping $APP" + msg_info "Stopping Service" systemctl stop fluid-calendar - msg_ok "Stopped $APP" + msg_ok "Stopped Service" cp /opt/fluid-calendar/.env /opt/fluid.env - rm -rf /opt/fluid-calendar - fetch_and_deploy_gh_release "fluid-calendar" "dotnetfactory/fluid-calendar" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "fluid-calendar" "dotnetfactory/fluid-calendar" - msg_info "Updating $APP" + msg_info "Updating Fluid Calendar" mv /opt/fluid.env /opt/fluid-calendar/.env cd /opt/fluid-calendar export NEXT_TELEMETRY_DISABLED=1 @@ -45,12 +44,12 @@ function update_script() { $STD npm run prisma:generate $STD npx prisma migrate deploy $STD npm run build:os - msg_ok "Updated $APP" + msg_ok "Updated Fluid Calendar" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start fluid-calendar - msg_ok "Started $APP" - msg_ok "Update Successful" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/forgejo.sh b/ct/forgejo.sh index 1e28ac7df..57fba1094 100644 --- a/ct/forgejo.sh +++ b/ct/forgejo.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -31,23 +31,20 @@ function update_script() { systemctl stop forgejo msg_ok "Stopped Service" - msg_info "Updating ${APP}" + msg_info "Updating Forgejo" RELEASE=$(curl -fsSL https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+' | sed 's/^v//') curl -fsSL "https://codeberg.org/forgejo/forgejo/releases/download/v${RELEASE}/forgejo-${RELEASE}-linux-amd64" -o "forgejo-$RELEASE-linux-amd64" rm -rf /opt/forgejo/* cp -r forgejo-$RELEASE-linux-amd64 /opt/forgejo/forgejo-$RELEASE-linux-amd64 chmod +x /opt/forgejo/forgejo-$RELEASE-linux-amd64 ln -sf /opt/forgejo/forgejo-$RELEASE-linux-amd64 /usr/local/bin/forgejo - msg_ok "Updated ${APP}" - - msg_info "Cleaning" rm -rf forgejo-$RELEASE-linux-amd64 - msg_ok "Cleaned" + msg_ok "Updated Forgejo" msg_info "Starting Service" systemctl start forgejo msg_ok "Started Service" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" exit } diff --git a/ct/freepbx.sh b/ct/freepbx.sh index be622f9e3..ab4cbd6ec 100644 --- a/ct/freepbx.sh +++ b/ct/freepbx.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,16 +20,16 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -f /lib/systemd/system/freepbx.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_error "Currently we don't provide an update function for this ${APP}." + if [[ ! -f /lib/systemd/system/freepbx.service ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_error "Currently we don't provide an update function for this ${APP}." + exit } start diff --git a/ct/freshrss.sh b/ct/freshrss.sh index 69acd16ce..b143d4b77 100644 --- a/ct/freshrss.sh +++ b/ct/freshrss.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,23 +20,23 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/freshrss ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/freshrss ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi - if [ ! -x /opt/freshrss/cli/sensitive-log.sh ]; then - msg_info "Fixing wrong permissions" - chmod +x /opt/freshrss/cli/sensitive-log.sh - systemctl restart apache2 - msg_ok "Fixed wrong permissions" - else - msg_error "FreshRSS should be updated via the user interface." - exit - fi + if [ ! -x /opt/freshrss/cli/sensitive-log.sh ]; then + msg_info "Fixing wrong permissions" + chmod +x /opt/freshrss/cli/sensitive-log.sh + systemctl restart apache2 + msg_ok "Fixed wrong permissions" + else + msg_error "FreshRSS should be updated via the user interface." + exit + fi } start diff --git a/ct/fumadocs.sh b/ct/fumadocs.sh index fe5c57599..ecbb708f7 100644 --- a/ct/fumadocs.sh +++ b/ct/fumadocs.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-5}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -44,7 +44,7 @@ function update_script() { exit 1 fi if ! command -v git &>/dev/null; then - $STD apt-get install -y git + $STD apt install -y git fi msg_info "Stopping service $SERVICE_NAME" @@ -60,8 +60,7 @@ function update_script() { msg_info "Starting service $SERVICE_NAME" systemctl start "$SERVICE_NAME" msg_ok "Started service $SERVICE_NAME" - - msg_ok "Fumadocs successfully updated" + msg_ok "Updated successfully" exit } diff --git a/ct/gatus.sh b/ct/gatus.sh index 31ce85cab..ebb01e0d3 100644 --- a/ct/gatus.sh +++ b/ct/gatus.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,9 +29,9 @@ function update_script() { exit fi if check_for_gh_release "gatus" "TwiN/gatus"; then - msg_info "Stopping $APP" + msg_info "Stopping Service" systemctl stop gatus - msg_ok "Stopped $APP" + msg_ok "Stopped Service" if [[ :$PATH: != *":/usr/local/bin:"* ]]; then echo 'export PATH="/usr/local/bin:$PATH"' >>~/.bashrc @@ -39,21 +39,20 @@ function update_script() { fi mv /opt/gatus/config/config.yaml /opt - rm -rf /opt/gatus - fetch_and_deploy_gh_release "gatus" "TwiN/gatus" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gatus" "TwiN/gatus" - msg_info "Updating $APP" + msg_info "Updating Gatus" 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" + msg_ok "Updated Gatus" - msg_info "Starting $APP" + msg_info "Starting Service" systemctl start gatus - msg_ok "Started $APP" - msg_ok "Update Successful" + msg_ok "Started Service" + msg_ok "Updated Successfully" fi exit } diff --git a/ct/ghostfolio.sh b/ct/ghostfolio.sh index 9b3b0f18c..c3ca3a23f 100644 --- a/ct/ghostfolio.sh +++ b/ct/ghostfolio.sh @@ -20,49 +20,45 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -f /opt/ghostfolio/dist/apps/api/main.js ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + if [[ ! -f /opt/ghostfolio/dist/apps/api/main.js ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi - if check_for_gh_release "ghostfolio" "ghostfolio/ghostfolio"; then - msg_info "Stopping Service" - systemctl stop ghostfolio - msg_ok "Stopped Service" + if check_for_gh_release "ghostfolio" "ghostfolio/ghostfolio"; then + msg_info "Stopping Service" + systemctl stop ghostfolio + msg_ok "Stopped Service" - msg_info "Creating Backup" - tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" \ - -C /opt \ - --exclude="ghostfolio/node_modules" \ - --exclude="ghostfolio/dist" \ - ghostfolio - mv /opt/ghostfolio/.env /opt/env.backup - msg_ok "Backup Created" + msg_info "Creating Backup" + tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" \ + -C /opt \ + --exclude="ghostfolio/node_modules" \ + --exclude="ghostfolio/dist" \ + ghostfolio + mv /opt/ghostfolio/.env /opt/env.backup + msg_ok "Backup Created" - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio" - msg_info "Updating Ghostfolio" - mv /opt/env.backup /opt/ghostfolio/.env - cd /opt/ghostfolio - $STD npm ci - $STD npm run build:production - $STD npx prisma migrate deploy - msg_ok "Updated Ghostfolio" + msg_info "Updating Ghostfolio" + mv /opt/env.backup /opt/ghostfolio/.env + cd /opt/ghostfolio + $STD npm ci + $STD npm run build:production + $STD npx prisma migrate deploy + msg_ok "Updated Ghostfolio" msg_info "Starting Service" systemctl start ghostfolio msg_ok "Started Service" - - msg_info "Cleaning Up" - $STD npm cache clean --force - msg_ok "Cleanup Completed" - msg_ok "Updated Successfully" - fi - exit + msg_ok "Updated successfully" + fi + exit } start diff --git a/ct/gitea-mirror.sh b/ct/gitea-mirror.sh index 5722f16a7..522fbdfe8 100644 --- a/ct/gitea-mirror.sh +++ b/ct/gitea-mirror.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-6}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -47,10 +47,10 @@ function update_script() { fi if [[ ! -f /opt/gitea-mirror.env ]]; then - msg_info "Detected old Enviroment, updating files" - APP_SECRET=$(openssl rand -base64 32) - HOST_IP=$(hostname -I | awk '{print $1}') - cat </opt/gitea-mirror.env + msg_info "Detected old Enviroment, updating files" + APP_SECRET=$(openssl rand -base64 32) + HOST_IP=$(hostname -I | awk '{print $1}') + cat </opt/gitea-mirror.env # See here for config options: https://github.com/RayLabsHQ/gitea-mirror/blob/main/docs/ENVIRONMENT_VARIABLES.md NODE_ENV=production HOST=0.0.0.0 @@ -77,7 +77,7 @@ WantedBy=multi-user.target EOF systemctl daemon-reload msg_ok "Old Enviroment fixed" -fi + fi if check_for_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"; then msg_info "Stopping Services" @@ -96,17 +96,15 @@ fi ln -sf /opt/bun/bin/bun /usr/local/bin/bunx msg_ok "Installed Bun" - rm -rf /opt/gitea-mirror - fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror" - msg_info "Updating and rebuilding ${APP}" + msg_info "Updating Gitea-Mirror" 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|^npm_package_version=.*|npm_package_version=${APP_VERSION}|" /opt/gitea-mirror.env - msg_ok "Updated and rebuilt ${APP}" + msg_ok "Updated Gitea-Mirror" msg_info "Restoring Data" cp /opt/gitea-mirror-backup/data/* /opt/gitea-mirror/data @@ -114,8 +112,8 @@ fi msg_info "Starting Service" systemctl start gitea-mirror - msg_ok "Service Started" - msg_ok "Update Successfully" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/gitea.sh b/ct/gitea.sh index e7d2acbc0..b2c7309af 100644 --- a/ct/gitea.sh +++ b/ct/gitea.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-8}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,18 +29,18 @@ function update_script() { exit fi if check_for_gh_release "gitea" "go-gitea/gitea"; then - msg_info "Stopping service" + msg_info "Stopping Service" systemctl stop gitea - msg_ok "Service stopped" + msg_ok "Stopped Service" rm -rf /usr/local/bin/gitea fetch_and_deploy_gh_release "gitea" "go-gitea/gitea" "singlefile" "latest" "/usr/local/bin" "gitea-*-linux-amd64" chmod +x /usr/local/bin/gitea - msg_info "Starting service" + msg_info "Starting Service" systemctl start gitea - msg_ok "Started service" - msg_ok "Update Successful" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/glance.sh b/ct/glance.sh index 8f2f582bb..5c4744075 100644 --- a/ct/glance.sh +++ b/ct/glance.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -39,7 +39,7 @@ function update_script() { msg_info "Starting Service" systemctl start glance msg_ok "Started Service" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" fi exit } diff --git a/ct/globaleaks.sh b/ct/globaleaks.sh index 9e37447b8..1415ac9b3 100644 --- a/ct/globaleaks.sh +++ b/ct/globaleaks.sh @@ -12,6 +12,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_os="${var_os:-debian}" var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" header_info "$APP" variables @@ -27,10 +28,12 @@ function update_script() { exit fi - msg_info "Updating $APP LXC" + msg_info "Updating Globaleaks" $STD apt update $STD apt -y upgrade - msg_ok "Updated $APP LXC" + msg_ok "Updated Globaleaks" + msg_ok "Updated successfully" + exit } start diff --git a/ct/go2rtc.sh b/ct/go2rtc.sh index fbc9b2606..0908e3cf7 100644 --- a/ct/go2rtc.sh +++ b/ct/go2rtc.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -29,16 +29,16 @@ function update_script() { fi if check_for_gh_release "go2rtc" "AlexxIT/go2rtc"; then - msg_info "Stopping service" + msg_info "Stopping Service" systemctl stop go2rtc - msg_ok "Stopped service" + msg_ok "Stopped Service" fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64" - msg_info "Starting service" + msg_info "Starting Service" systemctl start go2rtc - msg_ok "Started service" - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "Updated successfully" fi exit } diff --git a/ct/goaway.sh b/ct/goaway.sh index 26df280c2..720564ab7 100644 --- a/ct/goaway.sh +++ b/ct/goaway.sh @@ -38,8 +38,7 @@ function update_script() { msg_info "Starting Services" systemctl start goaway msg_ok "Started Services" - - msg_ok "Updated Successfully" + msg_ok "Updated successfully" fi exit } diff --git a/ct/gokapi.sh b/ct/gokapi.sh index 63fd95632..4edbd2607 100644 --- a/ct/gokapi.sh +++ b/ct/gokapi.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -37,7 +37,7 @@ function update_script() { msg_info "Starting Service" systemctl start gokapi msg_ok "Started Service" - msg_ok "Updated Successfully" + msg_ok "Updated successfully" fi exit } diff --git a/ct/gotify.sh b/ct/gotify.sh index 97a8379a3..813e8aa59 100644 --- a/ct/gotify.sh +++ b/ct/gotify.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" diff --git a/ct/grafana.sh b/ct/grafana.sh index d8bf30318..98545e164 100644 --- a/ct/grafana.sh +++ b/ct/grafana.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,19 +20,20 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - msg_info "Updating ${APP}" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated Successfully" - exit + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Updating Grafana" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Grafana" + msg_ok "Updated successfully" + exit } start diff --git a/ct/graylog.sh b/ct/graylog.sh index 0f12f6429..c808bf921 100644 --- a/ct/graylog.sh +++ b/ct/graylog.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-8192}" var_disk="${var_disk:-30}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,31 +20,28 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -d /etc/graylog ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Stopping $APP" - systemctl stop graylog-datanode - systemctl stop graylog-server - msg_ok "Stopped $APP" - - msg_info "Updating $APP" - $STD apt-get update - $STD apt-get upgrade -y - msg_ok "Updated $APP" - - msg_info "Starting $APP" - systemctl start graylog-datanode - systemctl start graylog-server - msg_ok "Started $APP" - - msg_ok "Update Successful" + if [[ ! -d /etc/graylog ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Stopping Services" + systemctl stop graylog-datanode graylog-server + msg_ok "Stopped Services" + + msg_info "Updating Graylog" + $STD apt update + $STD apt upgrade -y + msg_ok "Updated Graylog" + + msg_info "Starting Services" + systemctl start graylog-datanode graylog-server + msg_ok "Started Services" + msg_ok "Updated successfully" + exit } start diff --git a/ct/grist.sh b/ct/grist.sh index 5c6ce8157..76cbfcc1a 100644 --- a/ct/grist.sh +++ b/ct/grist.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-3072}" var_disk="${var_disk:-6}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -41,7 +41,7 @@ function update_script() { fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball" - msg_info "Updating ${APP}" + msg_info "Updating Grist" mkdir -p grist/docs cp -n /opt/grist_bak/.env /opt/grist/.env cp -r /opt/grist_bak/docs/* /opt/grist/docs/ @@ -50,12 +50,11 @@ function update_script() { $STD yarn install $STD yarn run build:prod $STD yarn run install:python - msg_ok "Updated ${APP}" + msg_ok "Updated Grist" msg_info "Starting Service" systemctl start grist msg_ok "Started Service" - msg_ok "Updated Successfully" fi exit diff --git a/ct/grocy.sh b/ct/grocy.sh index a97765053..869133bb3 100644 --- a/ct/grocy.sh +++ b/ct/grocy.sh @@ -32,8 +32,9 @@ function update_script() { PHP_VERSION="8.3" PHP_MODULE="sqlite3,bz2" PHP_APACHE="yes" setup_php fi if check_for_gh_release "grocy" "grocy/grocy"; then - msg_info "Updating ${APP}" - bash /var/www/html/update.sh + msg_info "Updating Grocy" + $STD bash /var/www/html/update.sh + msg_ok "Updated Grocy" msg_ok "Updated Successfully" fi exit diff --git a/ct/guardian.sh b/ct/guardian.sh index 60f4a4ea3..f56a3ca70 100755 --- a/ct/guardian.sh +++ b/ct/guardian.sh @@ -20,54 +20,53 @@ color catch_errors function update_script() { -header_info -check_container_storage -check_container_resources + header_info + check_container_storage + check_container_resources -if [[ ! -d "/opt/guardian" ]] ; then - msg_error "No ${APP} Installation Found!" + if [[ ! -d "/opt/guardian" ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "guardian" "HydroshieldMKII/Guardian"; then + msg_info "Stopping Services" + systemctl stop guardian-backend guardian-frontend + msg_ok "Stopped Services" + + if [[ -f "/opt/guardian/backend/plex-guard.db" ]]; then + msg_info "Backing up Database" + cp "/opt/guardian/backend/plex-guard.db" "/tmp/plex-guard.db.backup" + msg_ok "Backed up Database" + fi + + [[ -f "/opt/guardian/.env" ]] && cp "/opt/guardian/.env" "/opt" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian" + [[ -f "/opt/.env" ]] && mv "/opt/.env" "/opt/guardian" + + if [[ -f "/tmp/plex-guard.db.backup" ]]; then + msg_info "Restoring Database" + cp "/tmp/plex-guard.db.backup" "/opt/guardian/backend/plex-guard.db" + rm "/tmp/plex-guard.db.backup" + msg_ok "Restored Database" + fi + + msg_info "Updating Guardian" + cd /opt/guardian/backend + $STD npm ci + $STD npm run build + cd /opt/guardian/frontend + $STD npm ci + export DEPLOYMENT_MODE=standalone + $STD npm run build + msg_ok "Updated Guardian" + + msg_info "Starting Services" + systemctl start guardian-backend guardian-frontend + msg_ok "Started Services" + msg_ok "Updated Successfully" + fi exit -fi - -if check_for_gh_release "guardian" "HydroshieldMKII/Guardian" ; then - msg_info "Stopping Services" - systemctl stop guardian-backend guardian-frontend - msg_ok "Stopped Services" - - if [[ -f "/opt/guardian/backend/plex-guard.db" ]] ; then - msg_info "Backing up Database" - cp "/opt/guardian/backend/plex-guard.db" "/tmp/plex-guard.db.backup" - msg_ok "Backed up Database" - fi - - [[ -f "/opt/guardian/.env" ]] && cp "/opt/guardian/.env" "/opt" - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian" - [[ -f "/opt/.env" ]] && mv "/opt/.env" "/opt/guardian" - - if [[ -f "/tmp/plex-guard.db.backup" ]] ; then - msg_info "Restoring Database" - cp "/tmp/plex-guard.db.backup" "/opt/guardian/backend/plex-guard.db" - rm "/tmp/plex-guard.db.backup" - msg_ok "Restored Database" - fi - - msg_info "Updating Guardian" - cd /opt/guardian/backend - $STD npm ci - $STD npm run build - - cd /opt/guardian/frontend - $STD npm ci - export DEPLOYMENT_MODE=standalone - $STD npm run build - msg_ok "Updated Guardian" - - msg_info "Starting Services" - systemctl start guardian-backend guardian-frontend - msg_ok "Started Services" - msg_ok "Updated Successfully" -fi -exit } start