home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / gdm / gdm-ssh-session next >
Encoding:
Text File  |  2009-04-03  |  561 b   |  16 lines

  1. #!/bin/bash
  2.  
  3. ZENITY=`which zenity`
  4. TARGETHOSTPORT=`$ZENITY --title "Host and Port to connect to" --entry --text "Enter the name of the host and Port (host:port) you want to log in to."`
  5. TARGETHOST=${TARGETHOSTPORT%:*}
  6. TARGETPORT=${TARGETHOSTPORT#*:}
  7.  
  8. if [[ ! $TARGETHOSTPORT =~ ":" ]]; then
  9.     TARGETPORT="22"    
  10. fi
  11.  
  12. # @@@ should probably get a user name too;
  13. # for now can bet set using the $USERNAME@ convention
  14. # @@@ should it do an ssh-add so the user doesn't have to enter its passphrase again?
  15. ssh -A -X -T -n "$TARGETHOST" -p "$TARGETPORT" /etc/X11/Xsession
  16.