/usr/share/doc/iselect/examples/ilogin/ilogin is in iselect 1.4.0-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | #!/usr/bin/perl
##
## iLogin -- interactive login
## Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved.
##
require "$ENV{HOME}/.ilogin";
$tmpfile = "/tmp/tmp.ilogin.$$";
unlink($tmpfile);
open(FP, ">$tmpfile");
%LOGINCMD = ();
%FTPCMD = ();
foreach $l (@CFG) {
$area = $l->{AREA};
$hosts = $l->{HOSTS};
print FP "\n";
print FP "$area:\n";
foreach $h (@{$hosts}) {
$name = $h->{NAME};
$info = $h->{INFO};
$os = $h->{OS};
$type = $h->{TYPE};
$opt = $h->{OPT};
$passwd = $h->{PASSWD} || "$ENV{'LOGIN'}";
$home = $h->{HOME} || "/";
if ($type eq 'ssh') {
$cmd = "ssh $opt";
}
elsif ($type eq 'rlogin') {
$cmd = "rlogin $opt";
}
elsif ($type eq 'expect') {
$cmd = "expect -c 'set timeout 30'";
foreach $c (@{$opt}) {
$cmd .= " -c '".$c."'";
}
}
$LOGINCMD{$name} = $cmd;
($login, $host) = ($name =~ m|^(.+)@(.+)$|);
if ($login eq 'ftp' or $login eq 'anonymous') {
$user = '';
}
else {
$user = "$login:$passwd\@";
}
$FTPCMD{$name} = "cftp ftp://$user$host$home";
print FP sprintf("%-33s %-15s %-20s %6s <S:%s>\n", $name, $info, $os, $type, $name);
}
}
close(FP);
$rc = `iselect -n iLogin -t 'Select Remote Host...' -p3 -K -kf:RETURN <$tmpfile`;
if ($rc ne '') {
$rc =~ m|^(.+?):(.*)|;
($key, $name) = ($1, $2);
if ($key eq 'RETURN' or $key eq 'KEY_RIGHT') {
# Terminal Session
print $LOGINCMD{$name};
}
elsif ($key eq 'f') {
# FTP Session
print $FTPCMD{$name};
}
}
unlink($tmpfile);
##EOF##
|