Discard changes to filebrowser/run.sh
parent
726b3bf444
commit
b21ad06a95
@ -1,31 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Convert templated variables to shell variables
|
||||
ROOT_DIR=${FOLDER}
|
||||
PORT=${PORT}
|
||||
DB_PATH=${DB_PATH}
|
||||
LOG_PATH=${LOG_PATH}
|
||||
|
||||
# Expand ~ to $HOME
|
||||
ROOT_DIR=$${ROOT_DIR/#\~/$${HOME}}
|
||||
|
||||
BOLD='\033[0;1m'
|
||||
|
||||
printf "$${BOLD}Installing filebrowser \n\n"
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
|
||||
|
||||
printf "🥳 Installation complete! \n\n"
|
||||
printf "🥳 Installation comlete! \n\n"
|
||||
|
||||
printf "👷 Starting filebrowser in background... \n\n"
|
||||
|
||||
ROOT_DIR=${FOLDER}
|
||||
ROOT_DIR=$${ROOT_DIR/\~/$HOME}
|
||||
|
||||
DB_FLAG=""
|
||||
if [ "$${DB_PATH}" != "filebrowser.db" ]; then
|
||||
DB_FLAG="-d $${DB_PATH}"
|
||||
if [ "${DB_PATH}" != "filebrowser.db" ]; then
|
||||
DB_FLAG=" -d ${DB_PATH}"
|
||||
fi
|
||||
|
||||
printf "📂 Serving %s at http://localhost:%s \n\n" "$${ROOT_DIR}" "$${PORT}"
|
||||
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"
|
||||
|
||||
printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG}' \n\n"
|
||||
|
||||
filebrowser --noauth --root "$${ROOT_DIR}" --port "$${PORT}" "$${DB_FLAG}" > "$${LOG_PATH}" 2>&1 &
|
||||
filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} >${LOG_PATH} 2>&1 &
|
||||
|
||||
printf "📝 Logs at %s \n\n" "$${LOG_PATH}"
|
||||
printf "📝 Logs at ${LOG_PATH} \n\n"
|
||||
|
Loading…
Reference in New Issue