added db path optionality

pull/78/head
Stephen Kirby 2 years ago
parent b39fe7c4e8
commit 412c35033e

@ -18,7 +18,7 @@ variable "agent_id" {
variable "db_path" {
type = string
description = "The path to the filebrowser database."
default = "~/filebrowser.db"
default = null
}
variable "log_path" {

@ -12,10 +12,20 @@ printf "👷 Starting filebrowser in background... \n\n"
ROOT_DIR=${FOLDER}
ROOT_DIR=$${ROOT_DIR/\~/$HOME}
DB_COMMAND=""
if [ -z "${DB_PATH}" ]; then
echo "DB_PATH not set, skipping flag"
else
echo "DB_PATH is set!"
DB_COMMAND="-d ${DB_PATH}"
echo "Command: $${DB_COMMAND}"
fi
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"
printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT} -d ${DB_PATH}' \n\n"
printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_COMMAND}' \n\n"
filebrowser --noauth --root $ROOT_DIR --port ${PORT} -d ${DB_PATH} >${LOG_PATH} 2>&1 &
filebrowser --noauth --root $ROOT_DIR --port ${PORT} ${DB_COMMAND} >${LOG_PATH} 2>&1 &
printf "📝 Logs at ${LOG_PATH} \n\n"

Loading…
Cancel
Save