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.3 and 1.4

version 1.3, 2002/03/12 18:33:38 version 1.4, 2002/03/15 23:38:12
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  #%# {{{  
 # are using tcsh shell.  
   
 ##!/usr/bin/tcsh  if [ "$#" -lt 1 ]; then
 #  
 ## Set $DISPLAY enviroment if there is a record in ~/.Xauthority file  
 ## and user is logged in via ssh  
 #if ( $shlvl == 1 ) then  
 #       unsetenv DISPLAY  
 #       if ($?SSH_CLIENT) then  
 #               set DISP=`printenv SSH_CLIENT | awk '{print $1 }'`":0"  
 #               set count=`xauth list $DISP | wc -l`  
 #               if ( $count == 1 ) then  
 #                       echo "Setting DISPLAY "`(printenv SSH_CLIENT | awk '{print $1 }')`":0"  
 #                       setenv DISPLAY `printenv SSH_CLIENT | awk '{print $1 }'`:0  
 #               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  
 cat <<EOF  cat <<EOF
   
 Usage: $0 <ssh arguments>  Usage: $0 <ssh arguments>
Line 74  XAUTH_HOST_IP=`hostname -i | awk 'BEGIN
Line 28  XAUTH_HOST_IP=`hostname -i | awk 'BEGIN
 DISP=`xauth list $XAUTH_HOST_IP:0 | awk "{print \"$XAUTH_HOST_IP:0 \" \\$2 \" \" \\$3}"`  DISP=`xauth list $XAUTH_HOST_IP:0 | awk "{print \"$XAUTH_HOST_IP:0 \" \\$2 \" \" \\$3}"`
 ssh $* xauth add "$DISP"  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 ..."
         exit 1          exit 1
 fi  fi

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

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