add storagebox online checker service
This commit is contained in:
parent
bf37b70e85
commit
a42296cef7
1 changed files with 21 additions and 0 deletions
|
|
@ -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";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue