#!/bin/bash set -e # Function for logging log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" } # Function for cleanup cleanup() { log "Performing File Browser installation cleanup..." rm -rf /tmp/filebrowser* } # Trap to ensure cleanup on exit trap cleanup EXIT log "Starting File Browser installation..." log "Downloading and installing File Browser..." # Use the official installation script curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash log "Verifying File Browser installation..." if command -v filebrowser >/dev/null 2>&1; then FILEBROWSER_VERSION=$(filebrowser version 2>&1 | head -n1 || echo "Version check failed") log "File Browser installed successfully: ${FILEBROWSER_VERSION}" else log "ERROR: File Browser installation failed" exit 1 fi log "File Browser installation completed successfully"