Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created March 3, 2012 13:58
Show Gist options
  • Save Shinpeim/1966268 to your computer and use it in GitHub Desktop.
Save Shinpeim/1966268 to your computer and use it in GitHub Desktop.
$ ./m user@host # user@hostというディレクトリを(なければ)作ってそこにuser@hostをsshfsでマウント
$ ./u user@host # user@hostをアンマウントして user@hostというディレクトリを消す
ぼくは ~/mount に置いて使ってる
#!/bin/sh
if [ ! -e $1 ]; then
if ! mkdir $1; then
echo "couldn't make directory : $1" >& 2
exit 1
fi
fi
sshfs $1: $1
#!/bin/sh
if [ ! -e $1 ]; then
echo "no such mounted directory : $1" >& 2
exit 1
fi
if ! umount $1; then
echo "couldn't umount $1" >& 2
exit 1
fi
rmdir $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment