#!/bin/bash

#ip addr add 192.168.10.18/24 dev br0

RCLONE_DRIVE_NAME=tdrive
RCLONE_CONFIG_FILE=/boot/config/rclone/rclone.conf
RCLONE_LOG_FILE=/mnt/user/logs/rclone_mount_"$RCLONE_DRIVE_NAME".log
RCLONE_LOG_LEVEL=ERROR
RCLONE_CACHE_DRIVE=/mnt/user/app_cache/rclone_"$RCLONE_DRIVE_NAME"
RCLONE_MOUNT_LOCATION=/Union
RCLONE_MOUNT_POINT="$RCLONE_MOUNT_LOCATION"/"$RCLONE_DRIVE_NAME"
RCLONE_VFS_CACHE_MODE=full

rclone mount "$RCLONE_DRIVE_NAME": "$RCLONE_MOUNT_POINT" --config "$RCLONE_CONFIG_FILE" \
--allow-other \
--dir-cache-time 100h \
--log-level "$RCLONE_LOG_LEVEL"  \
--log-file "$RCLONE_LOG_FILE" \
--poll-interval 15s \
--cache-dir="$RCLONE_CACHE_DRIVE" \
--vfs-cache-mode "$RCLONE_VFS_CACHE_MODE" \
--vfs-cache-max-size 100G \
--vfs-cache-max-age 100h \
--umask 002 \
--user-agent cartacherandom \

#--bwlimit-file 16M
#--rc \
#--rc-user=cartache \
#--rc-pass=Cartache1X \
#--rc-web-gui \
#--rc-addr 192.168.10.18:5572 \

