#!/usr/local/bin/perl # edit_vgetty.cgi # Display the vgetty configuration for some serial port require './vgetty-lib.pl'; &ReadParse(); &foreign_require("inittab", "inittab-lib.pl"); if ($in{'new'}) { &ui_print_header(undef, $text{'vgetty_create'}, ""); } else { &ui_print_header(undef, $text{'vgetty_edit'}, ""); @vgi = &vgetty_inittabs(); ($init) = grep { $_->{'id'} eq $in{'id'} } @vgi; } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'vgetty_header'}
\n"; print "\n"; print "\n", $found ? "" : $init->{'tty'}, &file_chooser_button("other"); @conf = &get_config(); $rings = &find_value("rings", \@conf); if ($rings =~ /^\//) { $tf = $in{'new'} ? undef : &tty_opt_file($rings, $init->{'tty'}); print "\n"; printf "\n"; } $ans = &find_value("answer_mode", \@conf); if ($ans =~ /^\//) { $tf = $in{'new'} ? undef : &tty_opt_file($ans, $init->{'tty'}); print "\n"; printf "\n"; } print "
$text{'vgetty_tty'}\n"; printf " %s
$text{'vgetty_rings'} %s\n", -r $tf ? "" : "checked", $text{'vgetty_default'}; printf " %s\n", -r $tf ? "checked" : ""; open(TF, $tf); chop($rc = ); close(TF); print "
$text{'vgetty_ans'} %s\n", -r $tf ? "" : "checked", $text{'vgetty_default'}; printf " %s\n", -r $tf ? "checked" : ""; open(TF, $tf); chop($am = ); close(TF); print &answer_mode_input($am, "ans"),"
\n"; print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; &ui_print_footer("list_vgetty.cgi", $text{'vgetty_return'});