install.fairie/dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl

15 lines
417 B
Cheetah

[Unit]
Description=rclone r2 user service ({{ .user.username }})
After=network-online.target
[Service]
Type=simple
User={{ .user.username }}
ExecStartPre=/usr/bin/mkdir /home/{{ .user.username }}/.local/mnt/r2
ExecStart=/usr/local/bin/rclone-mount "user" "{{ .user.username }}" "r2"
ExecStop=/bin/fusermount -u /home/{{ .user.username }}/.local/mnt/r2
Restart=always
RestartSec=10
[Install]
WantedBy=default.target