mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-14 18:05:07 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dce4b0cc95 |
+38
-71
@@ -31,83 +31,50 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local proceed=false
|
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 Service"
|
||||||
|
systemctl --all stop 'fileflows*'
|
||||||
|
msg_info "Stopped Service"
|
||||||
|
|
||||||
if systemctl list-unit-files 'fileflows.service' --no-legend 2>/dev/null | grep -q '^fileflows\.service'; then
|
msg_info "Creating Backup"
|
||||||
tmp=$(mktemp)
|
ls /opt/*.tar.gz &>/dev/null && rm -f /opt/*.tar.gz
|
||||||
http_code=$(curl -sSL -X 'GET' "http://localhost:19200/api/status/update-available" -H 'accept: application/json' -o "$tmp" -w '%{http_code}' 2>/dev/null) || http_code="000"
|
backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz"
|
||||||
if [[ "$http_code" == "200" ]]; then
|
tar -czf "$backup_filename" -C /opt/fileflows Data
|
||||||
update_available=$(jq -r '.UpdateAvailable // false' "$tmp" 2>/dev/null)
|
msg_ok "Backup Created"
|
||||||
rm -f "$tmp"
|
|
||||||
if [[ "${update_available}" == "true" ]]; then
|
# FileFlows tracks the latest release, whose .NET target can move (e.g. 8 -> 10);
|
||||||
proceed=true
|
# ensure the current ASP.NET Core Runtime so an existing install doesn't fail to
|
||||||
else
|
# start after updating to a newer .NET major version.
|
||||||
msg_ok "No update required. ${APP} is already at latest version"
|
msg_info "Ensuring ASP.NET Core Runtime"
|
||||||
exit
|
if [[ "$(arch_resolve)" == "arm64" ]]; then
|
||||||
fi
|
if [[ ! -x /usr/lib/dotnet10/dotnet ]]; then
|
||||||
else
|
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
|
||||||
rm -f "$tmp"
|
$STD bash /tmp/dotnet-install.sh --channel 10.0 --runtime aspnetcore --install-dir /usr/lib/dotnet10
|
||||||
if [[ "$http_code" == "401" ]]; then
|
ln -sf /usr/lib/dotnet10/dotnet /usr/bin/dotnet
|
||||||
msg_warn "Could not check for updates: API returned 401 (security may be enabled)."
|
rm -f /tmp/dotnet-install.sh
|
||||||
else
|
|
||||||
msg_warn "Could not check for updates: API unreachable (HTTP ${http_code})."
|
|
||||||
fi
|
|
||||||
if [[ "${FORCE_UPDATE:-}" == "1" ]]; then
|
|
||||||
proceed=true
|
|
||||||
else
|
|
||||||
read -r -p "${TAB3}Force update without version check? [y/N]: " CONFIRM
|
|
||||||
if [[ "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|
||||||
proceed=true
|
|
||||||
else
|
|
||||||
msg_error "Update aborted."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
elif ! is_package_installed "aspnetcore-runtime-10.0"; then
|
||||||
|
$STD apt remove -y aspnetcore-runtime-8.0 aspnetcore-runtime-9.0 2>/dev/null || true
|
||||||
|
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
|
fi
|
||||||
|
msg_ok "Ensured ASP.NET Core Runtime"
|
||||||
|
|
||||||
|
fetch_and_deploy_from_url "https://fileflows.com/downloads/zip" "/opt/fileflows"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
|
systemctl --all start 'fileflows*'
|
||||||
|
msg_ok "Started Service"
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
else
|
else
|
||||||
proceed=true
|
msg_ok "No update required. ${APP} is already at latest version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$proceed" != "true" ]]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Stopping Service"
|
|
||||||
systemctl --all stop 'fileflows*'
|
|
||||||
msg_ok "Stopped Service"
|
|
||||||
|
|
||||||
msg_info "Creating Backup"
|
|
||||||
ls /opt/*.tar.gz &>/dev/null && rm -f /opt/*.tar.gz
|
|
||||||
backup_filename="/opt/${APP}_backup_$(date +%F).tar.gz"
|
|
||||||
tar -czf "$backup_filename" -C /opt/fileflows Data
|
|
||||||
msg_ok "Backup Created"
|
|
||||||
|
|
||||||
msg_info "Ensuring ASP.NET Core Runtime"
|
|
||||||
if [[ "$(arch_resolve)" == "arm64" ]]; then
|
|
||||||
if [[ ! -x /usr/lib/dotnet10/dotnet ]]; then
|
|
||||||
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
|
|
||||||
fi
|
|
||||||
elif ! is_package_installed "aspnetcore-runtime-10.0"; then
|
|
||||||
$STD apt remove -y aspnetcore-runtime-8.0 aspnetcore-runtime-9.0 2>/dev/null || true
|
|
||||||
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 "Ensured ASP.NET Core Runtime"
|
|
||||||
|
|
||||||
fetch_and_deploy_from_url "https://fileflows.com/downloads/zip" "/opt/fileflows"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
|
||||||
systemctl --all start 'fileflows*'
|
|
||||||
msg_ok "Started Service"
|
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,14 +35,12 @@ function update_script() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Backing up Data"
|
create_backup /opt/Heimdall/database \
|
||||||
cp -R /opt/Heimdall/database database-backup
|
/opt/Heimdall/public
|
||||||
cp -R /opt/Heimdall/public public-backup
|
PHP_VERSION="8.4" PHP_FPM="YES" setup_php
|
||||||
sleep 1
|
|
||||||
msg_ok "Backed up Data"
|
|
||||||
|
|
||||||
setup_composer
|
setup_composer
|
||||||
fetch_and_deploy_gh_release "Heimdall" "linuxserver/Heimdall" "tarball"
|
fetch_and_deploy_gh_release "Heimdall" "linuxserver/Heimdall" "tarball"
|
||||||
|
restore_backup
|
||||||
|
|
||||||
msg_info "Updating Heimdall-Dashboard"
|
msg_info "Updating Heimdall-Dashboard"
|
||||||
cd /opt/Heimdall
|
cd /opt/Heimdall
|
||||||
@@ -50,18 +48,6 @@ function update_script() {
|
|||||||
$STD composer dump-autoload
|
$STD composer dump-autoload
|
||||||
msg_ok "Updated Heimdall-Dashboard"
|
msg_ok "Updated Heimdall-Dashboard"
|
||||||
|
|
||||||
msg_info "Restoring Data"
|
|
||||||
cd ~
|
|
||||||
cp -R database-backup/* /opt/Heimdall/database
|
|
||||||
cp -R public-backup/* /opt/Heimdall/public
|
|
||||||
sleep 1
|
|
||||||
msg_ok "Restored Data"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf {public-backup,database-backup}
|
|
||||||
sleep 1
|
|
||||||
msg_ok "Cleaned Up"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start heimdall.service
|
systemctl start heimdall.service
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
@@ -55,12 +55,9 @@ if [[ "$install_server" =~ ^[Ss]$ ]]; then
|
|||||||
msg_ok "Installed FileFlows Server"
|
msg_ok "Installed FileFlows Server"
|
||||||
else
|
else
|
||||||
msg_info "Installing FileFlows Node"
|
msg_info "Installing FileFlows Node"
|
||||||
read -r -p "${TAB3}Enter FileFlows Server URL (e.g. http://192.168.1.10:19200): " server_url
|
|
||||||
while [[ -z "${server_url// /}" ]]; do
|
|
||||||
read -r -p "${TAB3}Enter FileFlows Server URL (e.g. http://192.168.1.10:19200): " server_url
|
|
||||||
done
|
|
||||||
cd /opt/fileflows/Node
|
cd /opt/fileflows/Node
|
||||||
$STD dotnet FileFlows.Node.dll --server "$server_url" --systemd install --root true
|
$STD dotnet FileFlows.Node.dll
|
||||||
|
$STD dotnet FileFlows.Node.dll --systemd install --root true
|
||||||
systemctl enable -q --now fileflows-node
|
systemctl enable -q --now fileflows-node
|
||||||
msg_ok "Installed FileFlows Node"
|
msg_ok "Installed FileFlows Node"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user