Created
March 3, 2012 13:58
-
-
Save Shinpeim/1966268 to your computer and use it in GitHub Desktop.
This file contains 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
$ ./m user@host # user@hostというディレクトリを(なければ)作ってそこにuser@hostをsshfsでマウント | |
$ ./u user@host # user@hostをアンマウントして user@hostというディレクトリを消す | |
ぼくは ~/mount に置いて使ってる |
This file contains 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/sh | |
if [ ! -e $1 ]; then | |
if ! mkdir $1; then | |
echo "couldn't make directory : $1" >& 2 | |
exit 1 | |
fi | |
fi | |
sshfs $1: $1 |
This file contains 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/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