|
| 1 | +#!/usr/bin/env bash |
| 2 | +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" |
| 3 | +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") |
| 4 | +# Copyright (c) 2021-2026 community-scripts ORG |
| 5 | +# Author: uchouT (uchouT) |
| 6 | +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE |
| 7 | +# Source: https://github.com/OpenListTeam/OpenList/ |
| 8 | + |
| 9 | +APP="OpenList" |
| 10 | +var_tags="${var_tags:-files;storage}" |
| 11 | +var_cpu="${var_cpu:-1}" |
| 12 | +var_arm64="${var_arm64:-yes}" |
| 13 | +var_unprivileged="${var_unprivileged:-1}" |
| 14 | +if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then |
| 15 | + var_os=$(msg_menu "Choose the container OS" \ |
| 16 | + "debian" "Debian 13" \ |
| 17 | + "alpine" "Alpine 3.24 (smaller)") |
| 18 | +fi |
| 19 | + |
| 20 | +if [[ "${var_os:-}" == "alpine" ]]; then |
| 21 | + var_ram="${var_ram:-512}" |
| 22 | + var_disk="${var_disk:-4}" |
| 23 | + var_version="${var_version:-3.24}" |
| 24 | +else |
| 25 | + var_ram="${var_ram:-1024}" |
| 26 | + var_disk="${var_disk:-6}" |
| 27 | + var_version="${var_version:-13}" |
| 28 | +fi |
| 29 | + |
| 30 | +header_info "$APP" |
| 31 | +variables |
| 32 | +color |
| 33 | +catch_errors |
| 34 | + |
| 35 | +function update_script() { |
| 36 | + header_info |
| 37 | + check_container_storage |
| 38 | + check_container_resources |
| 39 | + run_os_update |
| 40 | +} |
| 41 | + |
| 42 | +update_deb_based() { |
| 43 | + if [[ ! -f /opt/openlist/openlist ]]; then |
| 44 | + msg_error "No OpenList Installation Found!" |
| 45 | + exit 1 |
| 46 | + fi |
| 47 | + |
| 48 | + if check_for_gh_release "openlist" "OpenListTeam/OpenList"; then |
| 49 | + msg_info "Stopping OpenList" |
| 50 | + systemctl stop openlist |
| 51 | + msg_ok "Stopped OpenList" |
| 52 | + |
| 53 | + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "openlist" "OpenListTeam/OpenList" "prebuild" "latest" "/opt/openlist" "openlist-linux-musl-$(arch_resolve "amd64" "arm64").tar.gz" |
| 54 | + |
| 55 | + msg_info "Starting OpenList" |
| 56 | + systemctl start openlist |
| 57 | + msg_ok "Started OpenList" |
| 58 | + msg_ok "Updated successfully!" |
| 59 | + fi |
| 60 | +} |
| 61 | + |
| 62 | +update_alpine() { |
| 63 | + if [[ ! -f /opt/openlist/openlist ]]; then |
| 64 | + msg_error "No OpenList Installation Found!" |
| 65 | + exit 1 |
| 66 | + fi |
| 67 | + |
| 68 | + msg_info "Updating Alpine Packages" |
| 69 | + $STD apk -U upgrade |
| 70 | + msg_ok "Updated Alpine Packages" |
| 71 | + |
| 72 | + if check_for_gh_release "openlist" "OpenListTeam/OpenList"; then |
| 73 | + msg_info "Stopping OpenList" |
| 74 | + $STD rc-service openlist stop |
| 75 | + msg_ok "Stopped OpenList" |
| 76 | + |
| 77 | + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "openlist" "OpenListTeam/OpenList" "prebuild" "latest" "/opt/openlist" "openlist-linux-musl-$(arch_resolve "amd64" "arm64").tar.gz" |
| 78 | + |
| 79 | + msg_info "Starting OpenList" |
| 80 | + $STD rc-service openlist start |
| 81 | + msg_ok "Started OpenList" |
| 82 | + msg_ok "Updated successfully!" |
| 83 | + fi |
| 84 | +} |
| 85 | + |
| 86 | +start |
| 87 | +build_container |
| 88 | +description |
| 89 | + |
| 90 | +msg_ok "Completed Successfully!\n" |
| 91 | +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |
| 92 | +echo -e "${INFO}${YW}Access it using the following URL:${CL}" |
| 93 | +echo -e "${GATEWAY}${BGN}http://${IP}:5244${CL}" |
| 94 | +echo -e "${INFO}${YW}Credentials saved in:${CL}" |
| 95 | +echo -e "${TAB}/root/openlist.creds" |
0 commit comments