add storagebox online checker service

This commit is contained in:
Henry Hiles 2026-11-06 21:21:09 -05:00
commit a42296cef7
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -35,8 +35,29 @@
pkgs.sshfs pkgs.sshfs
]; ];
systemd.services.storagebox-online = {
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
TimeoutStartSec = "5min";
};
script = ''
until ${pkgs.openssh}/bin/sftp -b /dev/null \
-o BatchMode=yes -o ConnectTimeout=5 \
-i /home/quadradical/.ssh/id_ed25519 \
u675579@u675579.your-storagebox.de; do
echo "storage box not reachable yet, retrying in 5s"
sleep 5
done
'';
};
systemd.mounts = [ systemd.mounts = [
{ {
requires = [ "storagebox-online.service" ];
after = [ "storagebox-online.service" ];
what = "u675579@u675579.your-storagebox.de:/media"; what = "u675579@u675579.your-storagebox.de:/media";
where = "/var/lib/private/continuwuity/media"; where = "/var/lib/private/continuwuity/media";
type = "fuse.sshfs"; type = "fuse.sshfs";