Created
May 28, 2014 03:16
-
-
Save mattfelten/3f457d5a20beac82ea0b 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
# SSH Mounts | |
function fubarfunction() { | |
var1=${1-ssh}; | |
if [ $var1 == 'mount' ] | |
then | |
fubarfunction unmount | |
sshfs fubar:/home/matfel/ndn/ ~/Sites/Projects/Fubar/ -o sshfs_sync | |
echo 'Fubar Mounted' | |
fubarfunction edit | |
elif [ $var1 == 'unmount' ] | |
then | |
if [ $(mount | grep -c fubar) > 0 ] | |
then | |
umount -f ~/Sites/Projects/Fubar | |
echo 'Fubar Unmounted' | |
fi | |
elif [ $var1 == 'edit' ] | |
then | |
e ~/Sites/Projects/Fubar | |
elif [ $var1 == 'ssh' ] | |
then | |
ssh fubar | |
elif [ $var1 == 'm' ] | |
then | |
fubarfunction mount | |
elif [ $var1 == 'e' ] | |
then | |
fubarfunction edit | |
fi | |
} | |
alias fubar=fubarfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment