Compare commits

...

2 Commits

Author SHA1 Message Date
CanbiZ
3528d61171 Use TMP_BIN for filebrowser installation and updates
Refactor filebrowser installation to use a temporary binary path for updates.
2025-11-13 08:24:26 +01:00
CanbiZ
71e5aca857 Update filebrowser installation method
Download the filebrowser binary to a temporary location before moving it to the final installation path.
2025-11-13 08:22:15 +01:00

View File

@@ -30,6 +30,7 @@ INSTALL_PATH="/usr/local/bin/filebrowser"
CONFIG_PATH="/usr/local/community-scripts/fq-config.yaml"
DEFAULT_PORT=8080
SRC_DIR="/"
TMP_BIN="/tmp/filebrowser.$$"
# Get primary IP
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
@@ -109,8 +110,9 @@ if [[ -f "$INSTALL_PATH" ]]; then
read -r update_prompt
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Updating ${APP}"
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$INSTALL_PATH"
chmod +x "$INSTALL_PATH"
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$TMP_BIN"
chmod +x "$TMP_BIN"
mv -f "$TMP_BIN" /usr/local/bin/filebrowser
msg_ok "Updated ${APP}"
exit 0
else
@@ -133,8 +135,9 @@ fi
msg_info "Installing ${APP} on ${OS}"
$PKG_MANAGER curl ffmpeg &>/dev/null
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$INSTALL_PATH"
chmod +x "$INSTALL_PATH"
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$TMP_BIN"
chmod +x "$TMP_BIN"
mv -f "$TMP_BIN" /usr/local/bin/filebrowser
msg_ok "Installed ${APP}"
msg_info "Preparing configuration directory"