Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for scripts/shell/xssh/Attic/xssh.sh between version 1.2 and 1.3

version 1.2, 2002/02/04 14:26:31 version 1.3, 2002/03/12 18:33:38
Line 7 
Line 7 
 # Use this script to connect to remote host  # Use this script to connect to remote host
 # if you will running X aplications on this host  # if you will running X aplications on this host
   
 # On remote host put these lines to your ~/.tcshrc if you  # On remote host put these lines to your ~/.tcshrc if you  #%# {{{
 # are using tcsh shell.  # are using tcsh shell.
   
 #!/usr/bin/tcsh  ##!/usr/bin/tcsh
 #  #
 # Set $DISPLAY enviroment if there is a record in ~/.Xauthority file  ## Set $DISPLAY enviroment if there is a record in ~/.Xauthority file
 # and user is logged in via ssh  ## and user is logged in via ssh
 #if ( $shlvl == 1 ) then  #if ( $shlvl == 1 ) then
 #       unsetenv DISPLAY  #       unsetenv DISPLAY
 #       if ($?SSH_CLIENT) then  #       if ($?SSH_CLIENT) then
 #               set DISP=`printenv SSH_CLIENT | awk '{print $1 }'`":0"  #               set DISP=`printenv SSH_CLIENT | awk '{print $1 }'`":0"
 #               set count=`xauth list | grep ^$DISP| wc -l`  #               set count=`xauth list $DISP | wc -l`
 #               if ( $count == 1 ) then  #               if ( $count == 1 ) then
 #                       echo "Setting DISPLAY "`(printenv SSH_CLIENT | awk '{print $1 }')`":0"  #                       echo "Setting DISPLAY "`(printenv SSH_CLIENT | awk '{print $1 }')`":0"
 #                       setenv DISPLAY `printenv SSH_CLIENT | awk '{print $1 }'`:0  #                       setenv DISPLAY `printenv SSH_CLIENT | awk '{print $1 }'`:0
 #               endif  #               endif
 #       endif  #       endif
 #endif  #endif
   #%# }}}
   
   ## On remote host put these lines to your ~/.zshrc if you  ## {{{
   ## are using zsh(|bash?) shell.
   #
   ## set $DISPLAY enviroment using $SSH_CLIENT
   #disp()
   #{
   #       local DISP count
   #       export DISPLAY=
   #       if [ $?SSH_CLIENT ]; then
   #               DISP=( `printenv SSH_CLIENT | awk '{print $1 }'`:0 )
   #               count=( `xauth list $DISP | wc -l` )
   #               if [ $count = 1 ]; then
   #                       if [ $SHLVL != 1 ]; then
   #                               echo "Setting DISPLAY $DISP"
   #                       fi
   #                       export DISPLAY=$DISP
   #               fi
   #       fi
   #}
   ## }}}
   #
   ## If login shell then set display
   #if [ $SHLVL = 1 ]; then
   #       disp
   #fi
   
   
 if [ $# -lt 1 ]; then  if [ $# -lt 1 ]; then
Line 41  fi
Line 68  fi
 # Export ~/.Xauthority file to remote host  # Export ~/.Xauthority file to remote host
 #  #
 echo "Running xauth..."  echo "Running xauth..."
 UNAME=`uname -n`  #xauth extract - $DISPLAY | ssh $* xauth merge -
 ssh $* xauth add `xauth list |grep -v unix:0 | grep $UNAME`  #ssh $* xauth add `xauth list |grep -v unix`
   XAUTH_HOST_IP=`hostname -i | awk 'BEGIN {RS = " "} {print}' | awk '/^$/ {next;} ! /^127.0.0.1$/ {print}'`
   DISP=`xauth list $XAUTH_HOST_IP:0 | awk "{print \"$XAUTH_HOST_IP:0 \" \\$2 \" \" \\$3}"`
   ssh $* xauth add "$DISP"
   
 if [ $? -ne 0 ]; then  if [ $? -ne 0 ]; then
         echo "$0: Can't export \$DISPLAY to remote host, exiting ..."          echo "$0: Can't export \$DISPLAY to remote host, exiting ..."
Line 55  fi
Line 85  fi
 echo "Connecting with ssh..."  echo "Connecting with ssh..."
 ssh $*  ssh $*
   
   # Modeline for ViM {{{
   # vim:set ts=4:
   # vim600:fdm=marker fdl=0 fdc=3:
   # }}}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top