I’m making heavy use of Hetzner storageboxes, a rather slow network storage solution perfectly suited for backup tasks. Sadly they come with hickups resulting sometimes in a failed automount status where the machine may not recover from on it’s own. That’s so common that I got tired of checking monitoring or logging in to each individual machine. and to my aid!

for i in {bob,alice,steam,punk,younameit}; do echo "$i:"; systemctl --host "$i" status storagebox.automount; done
So how are my storagebox mounts today? Ah yes, yes, seems like two need a little pep talk.
Bash: Import variables from a .env file by tokudantokudan (Random texts)
This sets and exports all variables set in a .env file that can also be used by systemd to setup environment variables. Read and export ...

Yw, yes set -a / set +a before and after sourcing a file in bash makes this easier. I found out when I needed this to quickly source an env file used by a script that is launched and configured by systemd like this:

EnvironmentFile=%h/.config/foo.env

Sometimes I’ve to run this script manually so I do this to source the same config:

set -a
. /path/to/.config/foo.env
set +a
foo --bar