|
| 1 | +#!/usr/bin/env bash |
| 2 | +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) |
| 3 | +# Copyright (c) 2021-2026 community-scripts ORG |
| 4 | +# Author: kkroboth |
| 5 | +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |
| 6 | +# Source: https://fileflows.com/ |
| 7 | + |
| 8 | +APP="FileFlows" |
| 9 | +var_tags="${var_tags:-media;automation}" |
| 10 | +var_cpu="${var_cpu:-2}" |
| 11 | +var_ram="${var_ram:-2048}" |
| 12 | +var_disk="${var_disk:-8}" |
| 13 | +var_os="${var_os:-debian}" |
| 14 | +var_version="${var_version:-13}" |
| 15 | +var_unprivileged="${var_unprivileged:-1}" |
| 16 | +var_gpu="${var_gpu:-yes}" |
| 17 | + |
| 18 | +header_info "$APP" |
| 19 | +variables |
| 20 | +color |
| 21 | +catch_errors |
| 22 | + |
| 23 | +function update_script() { |
| 24 | + header_info |
| 25 | + check_container_storage |
| 26 | + check_container_resources |
| 27 | + |
| 28 | + if [[ ! -d /opt/fileflows ]]; then |
| 29 | + msg_error "No ${APP} Installation Found!" |
| 30 | + exit |
| 31 | + fi |
| 32 | + if ! [[ $(dpkg -s jq 2>/dev/null) ]]; then |
| 33 | + $STD apt-get update |
| 34 | + $STD apt-get install -y jq |
| 35 | + fi |
| 36 | + |
| 37 | + update_available=$(curl -fsSL -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' | jq .UpdateAvailable) |
| 38 | + if [[ "${update_available}" == "true" ]]; then |
| 39 | + msg_info "Stopping Service" |
| 40 | + systemctl stop fileflows |
| 41 | + msg_info "Stopped Service" |
| 42 | + |
| 43 | + msg_info "Creating Backup" |
| 44 | + backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz" |
| 45 | + tar -czf "$backup_filename" -C /opt/fileflows Data |
| 46 | + msg_ok "Backup Created" |
| 47 | + |
| 48 | + msg_info "Updating $APP to latest version" |
| 49 | + temp_file=$(mktemp) |
| 50 | + curl -fsSL https://fileflows.com/downloads/zip -o "$temp_file" |
| 51 | + $STD unzip -o -d /opt/fileflows "$temp_file" |
| 52 | + rm -rf "$temp_file" |
| 53 | + rm -rf "$backup_filename" |
| 54 | + msg_ok "Updated $APP to latest version" |
| 55 | + |
| 56 | + msg_info "Starting Service" |
| 57 | + systemctl start fileflows |
| 58 | + msg_ok "Started Service" |
| 59 | + msg_ok "Updated successfully!" |
| 60 | + else |
| 61 | + msg_ok "No update required. ${APP} is already at latest version" |
| 62 | + fi |
| 63 | + |
| 64 | + exit |
| 65 | +} |
| 66 | + |
| 67 | +start |
| 68 | +build_container |
| 69 | +description |
| 70 | + |
| 71 | +msg_ok "Completed successfully!\n" |
| 72 | +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |
| 73 | +echo -e "${INFO}${YW} Access it using the following URL:${CL}" |
| 74 | +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:19200${CL}" |
0 commit comments