#!/usr/local/bin/perl # Show the SSH 2 applet # XXX SSH1 vs 2 mode require '../web-lib.pl'; use Socket; &init_config(); require '../ui-lib.pl'; $theme_no_table = 1 if ($config{'sizemode'} == 1); &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); if ($config{'no_test'}) { # Just assume that the telnet server is running $rv = 1; } else { # Check if the telnet server is running $addr = $config{'host'} ? $config{'host'} : $ENV{'SERVER_NAME'} ? $ENV{'SERVER_NAME'} : &to_ipaddress(&get_system_hostname()); $port = $config{'port'} ? $config{'port'} : 22; if (inet_aton($addr)) { socket(STEST, PF_INET, SOCK_STREAM, getprotobyname("tcp")); $SIG{ALRM} = "connect_timeout"; alarm(10); $rv = connect(STEST, pack_sockaddr_in($port, inet_aton($addr))); close(STEST); } } if (!$rv) { if (inet_aton($addr)) { print "
",&text('index_esocket2', $addr, $port),"
\n"; } else { print "
",&text('index_elookup', $addr),"
\n"; } } else { print "