mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
More fixes from Todd
This commit is contained in:
@@ -7,7 +7,7 @@ use Socket;
|
||||
&ReadParse();
|
||||
$p = new Webmin::Page(undef, $text{'create_title'}, "create");
|
||||
$p->add_form(&get_create_form(\%in));
|
||||
$p->add_footer("", $text{'index_return'});
|
||||
$p->add_footer("index.cgi", $text{'index_return'});
|
||||
$p->print();
|
||||
exit;
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@ if ($in{'cfg'}) {
|
||||
}
|
||||
}
|
||||
push(@sysidcfg, [ 'name_service' => $ns ]);
|
||||
|
||||
# Set the NFS4 Domain as dynamic so that
|
||||
# upon first boot we don't get asked
|
||||
push(@sysidcfg, ['nfs4_domain' => "dynamic"]);
|
||||
|
||||
# Setup network interface config
|
||||
push(@sysidcfg, [ 'security_policy' => 'NONE' ]);
|
||||
@@ -140,27 +144,43 @@ if ($in{'inherit'} eq '0' ) {
|
||||
}
|
||||
}
|
||||
|
||||
#set the brand
|
||||
if ($in{'brand'}) {
|
||||
$d4 = new Webmin::DynamicHTML(\&create_brand,undef, $text{'create_brandmsg'});
|
||||
$p->add_form($d4);
|
||||
|
||||
sub create_brand
|
||||
{
|
||||
&set_zone_variable($zinfo,"brand",$form->get_value("brand"));
|
||||
$p->add_message_after($d4, $text{'create_done'});
|
||||
}
|
||||
}
|
||||
|
||||
if ($in{'install'}) {
|
||||
# Install software
|
||||
$d4 = new Webmin::DynamicText(\&execute_install);
|
||||
$p->add_form($d4);
|
||||
$d4->set_message($text{'create_installing'});
|
||||
$d4->set_wait(1);
|
||||
$d5 = new Webmin::DynamicText(\&execute_install);
|
||||
$p->add_form($d5);
|
||||
$d5->set_message($text{'create_installing'});
|
||||
$d5->set_wait(1);
|
||||
sub execute_install
|
||||
{
|
||||
local $ok = &callback_zone_command($zinfo, "install",
|
||||
\&Webmin::DynamicText::add_line, [ $d4 ]);
|
||||
\&Webmin::DynamicText::add_line, [ $d5 ]);
|
||||
if ($ok) {
|
||||
$p->add_message_after($d4, $text{'create_done'});
|
||||
$p->add_message_after($d5, $text{'create_done'});
|
||||
}
|
||||
else {
|
||||
$p->add_error_after($d4, $text{'create_failed'});
|
||||
$p->add_error_after($d5, $text{'create_failed'});
|
||||
}
|
||||
|
||||
if (@sysidcfg) {
|
||||
# Save the sysidcfg file
|
||||
&save_sysidcfg(\@sysidcfg, "$path/root/etc/sysidcfg");
|
||||
}
|
||||
if (-e "$path/root/etc/.UNCONFIGURED") {
|
||||
# If the file .UNCONFIGURED is there remove it
|
||||
&system_logged("rm -f $path/root/etc/.UNCONFIGUREED");
|
||||
}
|
||||
&config_zone_nfs($zinfo);
|
||||
&run_zone_command($zinfo, "boot");
|
||||
}
|
||||
@@ -174,17 +194,17 @@ else {
|
||||
|
||||
if ($in{'install'} && $in{'webmin'}) {
|
||||
# Create a Webmin setup script and run it
|
||||
$d5 = new Webmin::DynamicText(\&execute_webmin);
|
||||
$p->add_form($d5);
|
||||
$d5->set_message($text{'create_webmining'});
|
||||
$d5->set_wait(1);
|
||||
$d6 = new Webmin::DynamicText(\&execute_webmin);
|
||||
$p->add_form($d6);
|
||||
$d6->set_message($text{'create_webmining'});
|
||||
$d6->set_wait(1);
|
||||
|
||||
sub execute_webmin
|
||||
{
|
||||
$script = &get_zone_root($zinfo)."/tmp/install-webmin";
|
||||
$err = &create_webmin_install_script($zinfo, $script);
|
||||
if ($err) {
|
||||
$p->add_error_after($d5, &text('created_wfailed', $err));
|
||||
$p->add_error_after($d6, &text('created_wfailed', $err));
|
||||
}
|
||||
else {
|
||||
$ex = &run_in_zone_callback($zinfo, "/tmp/install-webmin",
|
||||
@@ -200,18 +220,6 @@ if ($in{'install'} && $in{'webmin'}) {
|
||||
}
|
||||
}
|
||||
|
||||
#set the brand
|
||||
if ($in{'brand'}) {
|
||||
$d6 = new Webmin::DynamicHTML(\&create_brand,undef, $text{'create_brandmsg'});
|
||||
$p->add_form($d6);
|
||||
|
||||
sub create_brand
|
||||
{
|
||||
&set_zone_variable($zinfo,"brand",$form->get_value("brand"));
|
||||
$p->add_message_after($d6, $text{'create_done'});
|
||||
}
|
||||
}
|
||||
|
||||
$p->add_footer("index.cgi", $text{'index_return'});
|
||||
$p->print();
|
||||
&webmin_log("create", "zone", $in{'name'});
|
||||
|
||||
@@ -52,7 +52,7 @@ elsif ($in{'install'}) {
|
||||
$d->set_message($text{'install_doing'});
|
||||
$d->set_wait(1);
|
||||
if ($in{'list'}) {
|
||||
$p->add_footer("", $text{'index_return'});
|
||||
$p->add_footer("index.cgi", $text{'index_return'});
|
||||
}
|
||||
else {
|
||||
$p->add_footer("edit_zone.cgi?zone=$zinfo->{'name'}",
|
||||
@@ -129,8 +129,11 @@ if ($ok) {
|
||||
$p->add_message($text{'create_done'});
|
||||
$sysidcfg = &zone_sysidcfg_file($in{'zone'});
|
||||
if (-r $sysidcfg) {
|
||||
# Move sysidcfg into place, for later boot
|
||||
&system_logged("mv $sysidcfg $zinfo->{'zonepath'}/root/etc/sysidcfg");
|
||||
# Copy sysidcfg into place, for later boot
|
||||
# We Copy instead of Move just incase we
|
||||
# uninstall the zone but want to reinstall it
|
||||
# at a later time.
|
||||
&system_logged("cp $sysidcfg $zinfo->{'zonepath'}/root/etc/sysidcfg");
|
||||
}
|
||||
&config_zone_nfs($zinfo);
|
||||
&webmin_log("install", "zone", $in{'zone'});
|
||||
|
||||
Reference in New Issue
Block a user