Created
March 12, 2019 17:52
-
-
Save jeanatcismet/096ecafc0cdabf163e8e0257a31ea7eb to your computer and use it in GitHub Desktop.
using docker container (farmcoolcow/rclone) for mounting a remote rclone directory into a local directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RCLONE_CONF=$1 | |
RCLONE_SRC=$2 | |
RCLONE_MOUNT_POINT=$3 | |
CONTAINER_NAME=rclone_mount | |
USER=$(whoami) | |
exit_script() { | |
sudo umount $RCLONE_MOUNT_POINT | |
} | |
trap exit_script INT TERM | |
docker run -t --rm --name $CONTAINER_NAME \ | |
-e PUID=$(id -u $USER) \ | |
-e PGID=$(id -g $USER) \ | |
-v $RCLONE_CONF:/home/.rclone.conf \ | |
--mount type=bind,source="$RCLONE_MOUNT_POINT",target=/data,bind-propagation=shared \ | |
--device /dev/fuse \ | |
--privileged \ | |
farmcoolcow/rclone \ | |
mount $RCLONE_SRC /data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment