#!/usr/local/bin/perl
# mgetty_apply.cgi
# Apply the current init config

require './pap-lib.pl';
$access{'mgetty'} || &error($text{'mgetty_ecannot'});
&error_setup($text{'mgetty_applyerr'});
%iconfig = &foreign_config("inittab");
$out = &backquote_logged("$iconfig{'telinit'} q 2>&1 </dev/null");
&error("<tt>$out</tt>") if ($?);
&kill_byname_logged("mgetty", 'TERM');
&webmin_log("mgetty_apply");
&redirect("list_mgetty.cgi");

