Skip to content

Instantly share code, notes, and snippets.

@canadaduane
Created January 4, 2013 03:24
Show Gist options
  • Save canadaduane/4449665 to your computer and use it in GitHub Desktop.
Save canadaduane/4449665 to your computer and use it in GitHub Desktop.
Mounts an external drive via SSHFS+OSXFuse, using a Linux Virtual Machine to read/write to an Ext3 filesystem.
UBUNTU_IP=172.16.232.100
GUEST_DIR=/media/duane
MOUNTPOINT=/tmp/archive
if [ ! -d "$MOUNTPOINT" ]; then
echo "Mount point $MOUNTPOINT does not exist, creating..."
mkdir -p $MOUNTPOINT
fi
FIRSTDIR=`ls -1 $MOUNTPOINT`
if [ "$FIRSTDIR" = "" ]; then
echo "Mounting via sshfs..."
sshfs root@$UBUNTU_IP:$GUEST_DIR $MOUNTPOINT -o daemon_timeout=500
fi
echo "Opening mount point in finder..."
open $MOUNTPOINT/`ls -1 $MOUNTPOINT`
@canadaduane
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment