Skip to content

Commit

Permalink
fish: mount_host_folder: Unmount if already mounted
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Mar 2, 2024
1 parent 8d2702d commit 156c422
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fish/functions/mount_host_folder.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
function mount_host_folder -d "Mount host folder in virtual machine"
sudo fish -c "
if not test -d $HOST_FOLDER
mkdir $HOST_FOLDER; or return
chown -R $USER:$USER $HOST_FOLDER; or return
mkdir $HOST_FOLDER
and chown -R $USER:$USER $HOST_FOLDER
end
if not mountpoint -q $HOST_FOLDER
mount -t virtiofs host $HOST_FOLDER; or return
end"
or return
if mountpoint -q $HOST_FOLDER
umount $HOST_FOLDER
end
mount -t virtiofs host $HOST_FOLDER"
end

0 comments on commit 156c422

Please sign in to comment.