diff --git a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb index 379106d..adca3fb 100644 --- a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb +++ b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb @@ -18,13 +18,14 @@ class MountSSHFS def self.sshfs_forward_is_folder_mounted(machine, opts) mounted = false - # expand the guest path so we can handle things like "~/vagrant" - expanded_guest_path = machine.guest.capability( - :shell_expand_guest_path, opts[:guestpath]) + # find the absolute path so that we can properly check if it is mounted + # https://github.com/dustymabe/vagrant-sshfs/issues/44 + absolute_guest_path = machine.guest.capability( + :sshfs_get_absolute_path, opts[:guestpath]) machine.communicate.execute("cat /proc/mounts") do |type, data| if type == :stdout data.each_line do |line| - if line.split()[1] == expanded_guest_path + if line.split()[1] == absolute_guest_path mounted = true break end