e43ff06510
- /system/usr/local/bin/executable_rclone-mount - /system/etc/systemd/system/r2-docker.service - /system/etc/systemd/system/r2-{{ .user.username }}.service.tmpl - /system/etc/sanoid/sanoid.conf.TODO - /system/etc/cockpit/machines.d/TODO.cockpit-machine.json.tmpl - /system/etc/keybase/config.json - /system/etc/rcloneignore - /system/.chezmoidata.yaml - /system/.chezmoiexternal.toml - /system/.chezmoiignore - /home/dot_config/rclone/rcloneignore - /home/dot_config/rclone/s3-docker.service.tmpl - /home/dot_config/rclone/s3-user.service.tmpl - /home/dot_config/rclone/merge_rclone.conf - /home/dot_config/cockpit/machines.d/cockpit-machine.json.TODO - /home/dot_config/keybase/config.json - /home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_20-font.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_50-rclone.tmpl - /home/.chezmoiexternal.toml
45 lines
1.7 KiB
Cheetah
45 lines
1.7 KiB
Cheetah
{{- if ne .host.distro.family "windows" -}}
|
|
#!/usr/bin/env bash
|
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
{{ includeTemplate "universal/logg" }}
|
|
|
|
if rclone -v rclone > /dev/null; then
|
|
logg info 'Ensuring /var/cache/rclone exists'
|
|
sudo mkdir -p /var/cache/rclone
|
|
sudo chmod 700 /var/cache/rclone
|
|
|
|
logg info 'Ensuring /var/log/rclone exists'
|
|
sudo mkdir -p /var/log/rclone
|
|
sudo chmod 700 /var/log/rclone
|
|
|
|
logg info 'Ensuring /mnt/s3-docker exists'
|
|
sudo mkdir -p /mnt/s3-docker
|
|
sudo chmod 700 /mnt/s3-docker
|
|
|
|
logg info 'Adding ~/.local/bin/rclone-mount to /usr/local/bin'
|
|
sudo cp -f "$HOME/.local/bin/rclone-mount" /usr/local/bin/rclone-mount
|
|
sudo chmod +x /usr/local/bin/rclone-mount
|
|
|
|
logg info 'Adding ~/.config/rclone/rcloneignore to /etc/rcloneignore'
|
|
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/rcloneignore" /etc/rcloneignore
|
|
sudo chmod 644 /etc/rcloneignore
|
|
|
|
if [ -d /etc/systemd/system ]; then
|
|
logg info 'Adding Docker S3 rclone mount (available at /mnt/docker-s3)'
|
|
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/s3-docker.service" /etc/systemd/system/docker-s3.service
|
|
logg info 'Enabling / restarting the S3 Docker mount'
|
|
sudo systemctl enable docker-s3
|
|
sudo systemctl restart docker-s3
|
|
|
|
logg info 'Adding user S3 rclone mount (available at ~/.local/mnt/s3)'
|
|
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/s3-user.service" "/etc/systemd/system/${USER}-s3.service"
|
|
logg info 'Enabling / restarting the S3 user mount'
|
|
sudo systemctl enable "${USER}-s3"
|
|
sudo systemctl restart "${USER}-s3"
|
|
fi
|
|
else
|
|
logg info '`rclone` is not available'
|
|
fi
|
|
|
|
{{ end -}}
|