sxt


#!/usr/bin/perl -w
#
#  sxt -- start a terminal for a remote system, optionally
#	as different user
#

use strict;

my %profile = qw {
  hypatia   Hypatia
  stark     Stark
  turing    Turing
  haiku     Haiku
  sullivan  Sullivan
  enigma    Enigma
  alberti   Alberti
  granite   Granite
  tautology Tautology
  franklin  Franklin
  bamboo    Bamboo
  dixville  Dixville
  ossipee   Ossipee
  unity     Unity
  neat1     Neat1
  neat2     Neat2
};

$#ARGV == 1 || $#ARGV == 0 || die "usage: $0 host <user>\n";

my $host = $ARGV[0];
my $user = ( $#ARGV == 1 ) ? $ARGV[1] : $ENV{'USER'};

if ( $profile{$host} ) {
    system("/usr/bin/gnome-terminal --window-with-profile=$profile{$host} ");
}
else {
    system( "/usr/bin/gnome-terminal --window-with-profile=UNH-Default "
          . "-e \'slogin -l $user $host\'" );
}