#!/usr/local/bin/perl # Show the SSH 2 applet BEGIN { push(@INC, ".."); }; use WebminCore; use Socket; &init_config(); $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()); $ip = &to_ipaddress($addr) || &to_ip6address($addr); $port = $config{'port'} ? $config{'port'} : 22; if ($ip) { $SIG{ALRM} = "connect_timeout"; alarm(10); &open_socket($ip, $port, STEST, \$err); close(STEST); $rv = !$err; } } if (!$rv) { if ($ip) { print "
",&text('index_esocket2', $addr, $port),"
\n"; } else { print "
",&text('index_elookup', $addr),"
\n"; } } else { print "