|
|
#!/bin/bash |
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
log() { |
|
|
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" |
|
|
} |
|
|
|
|
|
|
|
|
cleanup() { |
|
|
log "Performing File Browser installation cleanup..." |
|
|
rm -rf /tmp/filebrowser* |
|
|
} |
|
|
|
|
|
|
|
|
trap cleanup EXIT |
|
|
|
|
|
log "Starting File Browser installation..." |
|
|
|
|
|
log "Downloading and installing File Browser..." |
|
|
|
|
|
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" |
|
|
|