tidy up servo /mnt points

now we maintain /mnt/servo-media as a link to the "fastest" mountpoint
This commit is contained in:
colin 2022-06-14 00:13:39 -07:00
parent 7535986932
commit dfb7c997bb
4 changed files with 26 additions and 18 deletions

View File

@ -17,11 +17,11 @@ let sshOpts = {
};
in
{
fileSystems."/mnt/media-uninsane" = {
fileSystems."/mnt/servo-media-wan" = {
device = "colin@uninsane.org:/opt/uninsane/media";
inherit (sshOpts) fsType options;
};
fileSystems."/mnt/media-uninsane-lan" = {
fileSystems."/mnt/servo-media-lan" = {
device = "colin@servo:/opt/uninsane/media";
inherit (sshOpts) fsType options;
};

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -ex
mnt=/mnt/servo-media-wan
# if lan not mounted, then try to mount it
if ! (test -d /mnt/servo-media-lan/Music)
then
sudo mount /mnt/servo-media-lan && mnt=/mnt/servo-media-lan
fi
# if the needed mount isn't mounted, mount it
if ! (test -d $mnt/Music)
then
sudo mount $mnt
fi
# symlink the fastest mount point into place
sudo ln -sf $mnt /mnt/servo-media

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -ex
mnt=/mnt/media-uninsane
if ! (test -d /mnt/media-uninsane-lan/Music)
then
sudo mount /mnt/media-uninsane-lan && mnt=/mnt/media-uninsane-lan
fi
if ! (test -d $mnt/Music)
then
sudo mount $mnt
fi
rsync -arv --delete --progress $mnt/Music/ ~/Music/

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
sane-mount-servo
rsync -arv --delete --progress $mnt/Music/ ~/Music/