You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
723 B
Bash
29 lines
723 B
Bash
#!/usr/bin/env bash
|
|
|
|
BOLD='\033[0;1m'
|
|
printf "$${BOLD}Installing filebrowser \n\n"
|
|
|
|
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
|
|
|
|
printf "🥳 Installation comlete! \n\n"
|
|
|
|
printf "👷 Starting filebrowser in background... \n\n"
|
|
|
|
# Convert templated variables to shell variables
|
|
ROOT_DIR=${FOLDER}
|
|
ROOT_DIR=$${ROOT_DIR/\~/$HOME}
|
|
PORT=${PORT}
|
|
DB_PATH=${DB_PATH}
|
|
LOG_PATH=${LOG_PATH}
|
|
|
|
DB_FLAG=""
|
|
if [ "$${DB_PATH}" != "filebrowser.db" ]; then
|
|
DB_FLAG="-d $${DB_PATH}"
|
|
fi
|
|
|
|
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"
|
|
|
|
filebrowser --noauth --root "$${ROOT_DIR}" --port "$${PORT}" "$${DB_FLAG}" > "$${LOG_PATH}" 2>&1 &
|
|
|
|
printf "📝 Logs at %s \n\n" "$${LOG_PATH}"
|