Created
July 7, 2015 23:09
-
-
Save jdbrice/6a9db7fb5a99d67826ad to your computer and use it in GitHub Desktop.
A script for mounting sshfs locations on OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script for mounting remote directories using sshfs | |
| # $1 - remote host | |
| # $2 - remote dir | |
| # $3 - local mount point | |
| if mount | grep "on $3" > /dev/null; then | |
| echo "Local directory $3 already mounted" | |
| else | |
| echo "not mounted - trying to mount" | |
| echo "sshfs $1:$2 $3" | |
| sshfs $1:$2 $3 -oauto_cache,noappledouble | |
| fi | |
| if [ "$4" = "-reset" ] | |
| then | |
| echo "Trying to reset mount" | |
| echo "diskutil unmount $3" | |
| diskutil unmount $3 | |
| echo "Attempting to remount" | |
| echo "sshfs $1:$2 $3" | |
| sshfs $1:$2 $3 -oauto_cache,noappledouble | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment