3 # Displays a list of serial ports on which mgetty is enabled by searching
4 # for them in /etc/inittab
6 require './pap-lib.pl';
7 $access{'mgetty'} || &error($text{'mgetty_ecannot'});
8 &foreign_require("inittab", "inittab-lib.pl");
9 &ui_print_header(undef, $text{'mgetty_title'}, "");
11 if (!&has_command($config{'mgetty'})) {
12 print "<p>",&text('mgetty_ecmd', "<tt>$config{'mgetty'}</tt>"),"<p>\n";
13 &ui_print_footer("", $text{'index_return'});
16 print &text('mgetty_desc', "<tt>mgetty</tt>"),"<p>\n";
18 @mgi = &mgetty_inittabs();
20 print "<a href='edit_mgetty.cgi?new=1'>$text{'mgetty_add'}</a><br>\n";
21 print "<table border>\n";
22 print "<tr $tb> <td><b>$text{'mgetty_tty'}</b></td> ",
23 "<td><b>$text{'mgetty_type'}</b></td> ",
24 "<td><b>$text{'mgetty_speed'}</b></td> ",
25 "<td><b>$text{'mgetty_answer'}</b></td> ",
26 "<td><b>$text{'mgetty_config'}</b></td> </tr>\n";
29 local $tty = $m->{'tty'} =~ /^ttyS(\d+)$/ ?
30 &text('mgetty_ts', $1+1) :
31 $m->{'tty'} =~ /^term\/(\S+)$/ ?
32 &text('mgetty_ts', uc($1)) :
33 $m->{'tty'} =~ /^\// ? $m->{'tty'} : "/dev/$m->{'tty'}";
35 print "<td><a href='edit_mgetty.cgi?id=$m->{'id'}'>",
37 print "<td>",$m->{'direct'} ? $text{'mgetty_direct'}
38 : $text{'mgetty_modem'},"</td>\n";
39 print "<td>",$m->{'speed'} ||
40 $text{'mgetty_auto'},"</td>\n";
41 print "<td>",defined($m->{'rings'}) ? $m->{'rings'}
42 : 1," $text{'mgetty_rings'}</td>\n";
43 local $fn = $m->{'tty'};
46 if ($access{'options'}) {
47 print "<td><a href='edit_options.cgi?",
48 "file=$config{'ppp_options'}.$fn'>",
49 "$text{'mgetty_cedit'}</a></td>\n";
52 print "<td><br></td>\n";
56 print "<td>$tty</td>\n";
57 print "<td colspan=4>$text{'mgetty_vgetty'}</td>\n";
64 print "<b>$text{'mgetty_none'}</b><p>\n";
66 print "<a href='edit_mgetty.cgi?new=1'>$text{'mgetty_add'}</a><p>\n";
69 print "<form action=mgetty_apply.cgi>\n";
70 print "<table width=100%><tr>\n";
71 print "<td><input type=submit value='$text{'mgetty_apply'}'></td>\n";
72 print "<td>",&text('mgetty_applydesc', "<tt>telinit q</tt>"),"</td>\n";
73 print "</tr></table></form>\n";
75 &ui_print_footer("", $text{'index_return'});