#!/usr/local/bin/perl # edit_mgetty.cgi # Display the mgetty configuration for some serial port require './pap-lib.pl'; $access{'mgetty'} || &error($text{'mgetty_ecannot'}); &ReadParse(); &foreign_require("inittab", "inittab-lib.pl"); if ($in{'new'}) { &ui_print_header(undef, $text{'mgetty_create'}, ""); } else { &ui_print_header(undef, $text{'mgetty_edit'}, ""); @mgi = &mgetty_inittabs(); ($init) = grep { $_->{'id'} eq $in{'id'} } @mgi; } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'mgetty_header'}
\n"; print "\n"; print "\n", $found ? "" : $init->{'tty'}, &file_chooser_button("other"); print "\n"; printf "\n", $init->{'direct'} ? "" : "checked", $text{'mgetty_modem'}; print "\n"; printf "\n", $init->{'speed'}, $text{'mgetty_baud'}; print "\n"; printf "\n", defined($init->{'rings'}) ? $init->{'rings'} : 1, $text{'mgetty_rings'}; print "\n"; printf "\n", $init->{'fax'} ? "checked" : "", $text{'mgetty_f'}; print "\n"; printf "\n", $init->{'back'}, $text{'mgetty_secs'}; print "\n"; printf "\n", $init->{'prompt'}; print "
$text{'mgetty_tty'}\n"; printf " %s$text{'mgetty_type'} %s\n", $init->{'direct'} ? "checked" : "", $text{'mgetty_direct'}; printf " %s
$text{'mgetty_speed'} %s\n", $init->{'speed'} ? "" : "checked", $text{'mgetty_auto'}; printf "\n", $init->{'speed'} ? "checked" : ""; printf " %s$text{'mgetty_answer'} %s
$text{'mgetty_mode'} %s\n", $init->{'data'} || $init->{'fax'} ? "" : "checked", $text{'mgetty_df'}; printf " %s\n", $init->{'data'} ? "checked" : "", $text{'mgetty_d'}; printf " %s$text{'mgetty_back'} %s\n", $init->{'back'} ? "" : "checked", $text{'mgetty_back_def'}; printf "\n", $init->{'back'} ? "checked" : ""; printf " %s
$text{'mgetty_prompt'} %s\n", $init->{'prompt'} ? "" : "checked", $text{'default'}; printf "\n", $init->{'prompt'} ? "checked" : ""; printf "
\n"; print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; &ui_print_footer("list_mgetty.cgi", $text{'mgetty_return'});