Created
August 7, 2023 20:47
-
-
Save trysten/35e1d18f3249234c711d7d1196067127 to your computer and use it in GitHub Desktop.
rclone mount systemd template
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
[Install] | |
# not sure what to put here | |
WantedBy=default.target | |
[Unit] | |
Description=mount rclone remote %i in home/mnt | |
Documentation=https://rclone.org/docs/ | |
[Service] | |
Type=simple | |
# ensure the directory exists | |
# TODO: ensure empty | |
# -p in case this is the first run, to create parent dir 'mnt' | |
ExecStartPre=mkdir -p %h/mnt/%i | |
# %h: user homedir | |
# %i template instance name | |
ExecStart=%h/.local/bin/rclone mount %i: %h/mnt/%i | |
# unmounting will trigger rclone to die | |
ExecStop=fusermount -u %h/mnt/%i ; rmdir %h/mnt/%i | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment