mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-24 04:05:03 +00:00
Every interactive prompt takes a var_<app>_<name> override and treats a closed stdin like Enter (`|| true`), so an install keeps going after the console that started it is gone. Values the script cannot do without end with exit 64 and name the variable to set. Validation loops stop asking when nobody can answer instead of spinning on an empty read.
80 lines
3.0 KiB
Bash
80 lines
3.0 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: kkroboth
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://fileflows.com/
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
msg_info "Installing Dependencies"
|
|
$STD apt install -y \
|
|
ffmpeg \
|
|
pciutils \
|
|
imagemagick
|
|
msg_ok "Installed Dependencies"
|
|
|
|
setup_hwaccel
|
|
|
|
msg_info "Installing ASP.NET Core Runtime"
|
|
if [[ "$(arch_resolve)" == "arm64" ]]; then
|
|
# packages.microsoft.com only ships amd64 debs for Debian; use dotnet-install on arm64
|
|
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
|
|
$STD bash /tmp/dotnet-install.sh --channel 10.0 --runtime aspnetcore --install-dir /usr/lib/dotnet10
|
|
ln -sf /usr/lib/dotnet10/dotnet /usr/bin/dotnet
|
|
rm -f /tmp/dotnet-install.sh
|
|
else
|
|
setup_deb822_repo \
|
|
"microsoft" \
|
|
"https://packages.microsoft.com/keys/microsoft-2025.asc" \
|
|
"https://packages.microsoft.com/debian/13/prod/" \
|
|
"trixie"
|
|
$STD apt install -y aspnetcore-runtime-10.0
|
|
fi
|
|
msg_ok "Installed ASP.NET Core Runtime"
|
|
|
|
fetch_and_deploy_from_url "https://fileflows.com/downloads/ff-latest.tar.xz" "/opt/fileflows"
|
|
|
|
$STD ln -svf /usr/bin/ffmpeg /usr/local/bin/ffmpeg
|
|
$STD ln -svf /usr/bin/ffprobe /usr/local/bin/ffprobe
|
|
$STD rm -rf /opt/fileflows/Server/runtimes/win-*
|
|
|
|
install_server="${var_fileflows_mode:-}"
|
|
[[ -n "$install_server" ]] || read -r -p "${TAB3}Do you want to install FileFlows Server or Agent? (S/A): " install_server || true
|
|
|
|
if [[ "$install_server" =~ ^[Ss]$ ]]; then
|
|
msg_info "Installing FileFlows Server"
|
|
cd /opt/fileflows/Server
|
|
$STD dotnet FileFlows.Server.dll --systemd install --root true
|
|
systemctl enable -q --now fileflows
|
|
msg_ok "Installed FileFlows Server"
|
|
else
|
|
server_url="${var_fileflows_server_url:-}"
|
|
[[ -n "$server_url" ]] || read -r -p "${TAB3}Enter FileFlows Server URL (e.g. http://192.168.1.10:19200): " server_url || true
|
|
while [[ -z "${server_url// /}" ]]; do
|
|
read -r -p "${TAB3}Enter FileFlows Server URL (e.g. http://192.168.1.10:19200): " server_url || { msg_error "No FileFlows Server URL given; set var_fileflows_server_url or answer the prompt"; exit 64; }
|
|
done
|
|
msg_info "Installing FileFlows Agent"
|
|
cd /opt/fileflows/Agent
|
|
before_units="$(systemctl list-unit-files 'fileflows*' --no-legend 2>/dev/null | awk '{print $1}' | sort || true)"
|
|
$STD dotnet FileFlows.Agent.dll --server "$server_url" --systemd install --root true
|
|
after_units="$(systemctl list-unit-files 'fileflows*' --no-legend 2>/dev/null | awk '{print $1}' | sort || true)"
|
|
agent_unit="$(comm -13 <(echo "$before_units") <(echo "$after_units") | head -n1)"
|
|
if [[ -n "$agent_unit" ]]; then
|
|
systemctl enable -q --now "$agent_unit"
|
|
else
|
|
msg_warn "Could not detect the FileFlows Agent systemd unit; start it manually (systemctl list-unit-files 'fileflows*')."
|
|
fi
|
|
msg_ok "Installed FileFlows Agent"
|
|
fi
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|