Skip to content

Instantly share code, notes, and snippets.

@mattfelten
Created May 28, 2014 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfelten/3f457d5a20beac82ea0b to your computer and use it in GitHub Desktop.
Save mattfelten/3f457d5a20beac82ea0b to your computer and use it in GitHub Desktop.
# 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