Last active
August 6, 2022 15:52
-
-
Save u8sand/704ae0b0fe2312ab92869139d6ecda3a to your computer and use it in GitHub Desktop.
A simple script for serving one store with all rclone remotes as directories. I use this as a daemon which can be accessed with dolphin :)
This file contains hidden or 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/bash | |
# `rclone serve -h` for other remotes / arguments | |
PROTOCOL="webdav" | |
ARGS="--vfs-cache-mode writes" | |
# we construct an inline combined upstream with all remotes using the remote name as the directory | |
rclone listremotes \ | |
| awk -F':' -v ARGS="${ARGS}" -v PROTOCOL="${PROTOCOL}" " | |
BEGIN { | |
printf \"rclone serve \"ARGS\" \"PROTOCOL\" ':combine,upstreams=\\\"\" | |
} { | |
printf \" \"\$1\"=\"\$0 | |
} | |
END { | |
printf \"\\\":'\" | |
}" \ | |
| sh - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment