2022-08-31 02:55:15 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
mnt=/mnt/servo-root-wan
|
|
|
|
# if lan not mounted, then try to mount it
|
|
|
|
if ! (test -d /mnt/servo-root-lan/nix)
|
|
|
|
then
|
|
|
|
sudo mount /mnt/servo-root-lan && mnt=/mnt/servo-root-lan
|
|
|
|
fi
|
|
|
|
|
|
|
|
# if the needed mount isn't mounted, mount it
|
|
|
|
if ! (test -d $mnt/nix)
|
|
|
|
then
|
|
|
|
sudo mount $mnt
|
|
|
|
fi
|
|
|
|
|
|
|
|
# symlink the fastest mount point into place
|
2022-10-02 08:26:50 +00:00
|
|
|
# uncomment if i see the bug again: sudo unlink /mnt/servo-root # XXX ln gets confused if the destination is a symlink to a stale mount
|
2022-08-31 02:55:15 +00:00
|
|
|
sudo ln -sf $mnt /mnt/servo-root
|