sane-mount-servo: fix so we really do prefer lan over wan mounts
This commit is contained in:
parent
e527beb9d0
commit
1e67b5c97e
|
@ -1,19 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
mnt=/mnt/servo-media-wan
|
|
||||||
# if lan not mounted, then try to mount it
|
# if lan not mounted, then try to mount it
|
||||||
if ! (test -d /mnt/servo-media-lan/Music)
|
if ! (test -d /mnt/servo-media-lan/Music)
|
||||||
then
|
then
|
||||||
sudo mount /mnt/servo-media-lan && mnt=/mnt/servo-media-lan
|
sudo mount /mnt/servo-media-lan
|
||||||
|
fi
|
||||||
|
# not much reason not to mount the wan while we're here.
|
||||||
|
if ! (test -d /mnt/servo-media-wan/Music)
|
||||||
|
then
|
||||||
|
sudo mount /mnt/servo-media-wan
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if the needed mount isn't mounted, mount it
|
mnt=/mnt/servo-media-wan
|
||||||
if ! (test -d $mnt/Music)
|
# if the LAN is accessible, prefer that
|
||||||
then
|
test -d /mnt/servo-media-wan/Music && mnt=/mnt/servo-media-lan
|
||||||
sudo mount $mnt
|
|
||||||
fi
|
|
||||||
|
|
||||||
# symlink the fastest mount point into place
|
# symlink the fastest mount point into place
|
||||||
# uncomment if i see the bug again: sudo unlink /mnt/servo-media # XXX ln gets confused if the destination is a symlink to a stale mount
|
# uncomment if i see the bug again: sudo unlink /mnt/servo-media # XXX ln gets confused if the destination is a symlink to a stale mount
|
||||||
sudo ln -sf $mnt /mnt/servo-media
|
sudo ln -sf --no-dereference $mnt /mnt/servo-media
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
mnt=/mnt/servo-root-wan
|
|
||||||
# if lan not mounted, then try to mount it
|
# if lan not mounted, then try to mount it
|
||||||
if ! (test -d /mnt/servo-root-lan/nix)
|
if ! (test -d /mnt/servo-root-lan/nix)
|
||||||
then
|
then
|
||||||
sudo mount /mnt/servo-root-lan && mnt=/mnt/servo-root-lan
|
sudo mount /mnt/servo-root-lan
|
||||||
|
fi
|
||||||
|
# not much reason not to mount the wan while we're here.
|
||||||
|
if ! (test -d /mnt/servo-root-wan/nix)
|
||||||
|
then
|
||||||
|
sudo mount /mnt/servo-root-wan
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if the needed mount isn't mounted, mount it
|
mnt=/mnt/servo-root-wan
|
||||||
if ! (test -d $mnt/nix)
|
# if the LAN is accessible, prefer that
|
||||||
then
|
test -d /mnt/servo-root-wan/nix && mnt=/mnt/servo-root-lan
|
||||||
sudo mount $mnt
|
|
||||||
fi
|
|
||||||
|
|
||||||
# symlink the fastest mount point into place
|
# symlink the fastest mount point into place
|
||||||
# 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
|
# 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
|
||||||
sudo ln -sf $mnt /mnt/servo-root
|
sudo ln -sf --no-dereference $mnt /mnt/servo-root
|
||||||
|
|
Loading…
Reference in New Issue
Block a user