Streamline installation of all further software

This commit is contained in:
Manuel Thalmann 2024-07-17 14:18:27 +02:00
parent f1163a12c8
commit 719a9ab8ff
36 changed files with 679 additions and 9 deletions

View file

@ -0,0 +1,11 @@
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function configureSW -V dir
sudo cp "$dir/rclone.service" "$dir/rclone.target" "$dir/rclone@.service" /etc/systemd/user
end
runInstaller $argv
end

View file

@ -0,0 +1,10 @@
[Unit]
Description=rclone Service Starter
Documentation=man:rclone(1)
[Service]
Type=simple
ExecStart=bash -c 'sleep 10; systemctl --user start rclone.target'
[Install]
WantedBy=default.target

View file

@ -0,0 +1,3 @@
[Unit]
Description=rclone Mounts
Documentation=man:rclone(1)

View file

@ -0,0 +1,35 @@
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
[Service]
Type=notify
Environment="EXPRESSION=%i"
ExecStart= \
bash -c ' \
args=; \
target="$(echo "$EXPRESSION" | cut -d":" -f1)"; \
dirname="$(echo "$EXPRESSION" | cut -d":" -f2)"; \
cacheDuration="$(echo "$EXPRESSION" | cut -d":" -f3)"; \
\
if [ ! -z "$cacheDuration" ]; \
then \
args="--vfs-cache-max-age=$cacheDuration"; \
fi; \
\
destination="`cd "%h/.mnt"; realpath -m "$dirname"`"; \
mkdir -p "$destination"; \
mkdir -p /tmp/rclone; \
/usr/bin/rclone mount \
--config="%h/.config/rclone/rclone.conf" \
--vfs-cache-mode full \
--log-file /tmp/rclone/$target.log \
$args \
$target: "$destination";'
ExecStop=bash -c '/bin/fusermount -zu "`cd "%h/.mnt"; realpath "$(echo "$EXPRESSION" | cut -d":" -f2)"`"'
Restart=always
RestartSec=10
[Install]
WantedBy=rclone.target