Keep a link

From mn/geo/geoit
Revision as of 15:32, 13 October 2015 by Johnbur@uio.no (talk | contribs) (Created page with "# .bash_profile for hycamp group # The purpose of this file is to enable # sshfs mounting of a directory that # contains your bash customizations so # that the directory may...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  1. .bash_profile for hycamp group
  2. The purpose of this file is to enable
  3. sshfs mounting of a directory that
  4. contains your bash customizations so
  5. that the directory may be kept consistent
  6. across machines in the network
  7. This file should live in your $HOME
  8. and assumes you have a symlink to your
  9. customized bashrc file as defined by
  10. the bashfile variable below.
  11. johnbur 15.07.03


bashfile=$HOME/.mnts/net/nunatak/mn/nunatak/hycamp/team/$USER/dot/bashrc

  1. generate a .display file (used as a trick for screen sessions)

echo "export DISPLAY=$DISPLAY" > .display.`whoami`.`hostname`

  1. A test to see whether we've already mounted the sverdrup net

net="$HOME/.mnts/net" mounted=`cat /etc/mtab | grep $net | awk '{print $2}'`

if [ "$net" == "$mounted" ]; then

   echo "Sverdrup mount exists"

else

   #/net
   if [ ! -d $net ]; then
       mkdir $net
   fi  
   sshfs -o IdentityFile=~/.ssh/id_rsa $USER@sverdrup:/net $net

fi

if [ -n "$BASH_VERSION" ]; then

   # include .bashrc if it exists
   # my .bashrc file is actually sourced
   # from a file called bashrc in .dot
   # folder (which is symlinked to our
   # team network share)
   #   
   if [ -f $bashfile ]; then
   . $bashfile
   fi  

fi