Skip to content

Instantly share code, notes, and snippets.

@szalai1
Created July 28, 2015 11:43
Show Gist options
  • Save szalai1/6e74b01324dea265bbfb to your computer and use it in GitHub Desktop.
Save szalai1/6e74b01324dea265bbfb to your computer and use it in GitHub Desktop.
sshfs
function mount_sshfs_if_needed {
if [ "$(df -P "$2")" == "$(df -P "$2/..")" ]; then
command=(sshfs -o idmap=user $1 $2)
echo "${command[@]}"
"${command[@]}"
fi
}
mount_sshfs_if_needed $USER@info:/mnt/idms /home/$USER/idms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment