|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/usr/libexec/webmin/vgetty/ |
Upload File : |
#!/usr/bin/perl
# list_vgetty.cgi
# Displays a list of serial ports on which vgetty is enabled by searching
# for them in /etc/inittab
require './vgetty-lib.pl';
&foreign_require("inittab", "inittab-lib.pl");
&ui_print_header(undef, $text{'vgetty_title'}, "");
print &text('vgetty_desc', "<tt>vgetty</tt>"),"<p>\n";
@vgi = &vgetty_inittabs();
if (@vgi) {
print "<a href='edit_vgetty.cgi?new=1'>$text{'vgetty_add'}</a><br>\n";
print "<table border>\n";
print "<tr $tb> <td><b>$text{'vgetty_tty'}</b></td> ",
"<td><b>$text{'vgetty_type'}</b></td> </tr>\n";
foreach $v (@vgi) {
print "<tr $cb>\n";
local $tty = $v->{'tty'} =~ /^ttyS(\d+)$/ ?
&text('vgetty_ts', $1+1) :
$v->{'tty'} =~ /^\// ? $v->{'tty'} : "/dev/$v->{'tty'}";
if ($v->{'vgetty'}) {
print "<td><a href='edit_vgetty.cgi?id=$v->{'id'}'>",
"$tty</a></td>\n";
print "<td>$text{'vgetty_vgetty'}</td>\n";
}
else {
print "<td>$tty</td>\n";
print "<td>$text{'vgetty_mgetty'}</td>\n";
}
print "</tr>\n";
}
print "</table>\n";
}
else {
print "<b>$text{'vgetty_none'}</b><p>\n";
}
print "<a href='edit_vgetty.cgi?new=1'>$text{'vgetty_add'}</a><p>\n";
&ui_print_footer("", $text{'index_return'});