3 # Create a new root zone
5 require './bind8-lib.pl';
7 &error_setup($text{'hcreate_err'});
8 $access{'master'} || &error($text{'hcreate_ecannot'});
9 $access{'ro'} && &error($text{'master_ero'});
12 &allowed_zone_file(\%access, $in{'file'}) ||
13 &error(&text('hcreate_efile', $in{'file'}));
14 &lock_file(&make_chroot($in{'file'}));
15 open(FILE, ">>".&make_chroot($in{'file'})) ||
16 &error($text{'hcreate_efile2'});
19 # Get the root server information
20 if ($in{'real'} == 1) {
21 # Download from internic
22 $err = &download_root_zone($in{'file'});
23 &error($err) if ($err);
25 elsif ($in{'real'} == 2) {
27 ©_source_dest("$module_root_directory/db.cache",
28 &make_chroot($in{'file'}));
31 # Just check the existing file
32 @recs = &read_zone_file(&make_chroot($in{'file'}), ".");
33 &error($text{'mcreate_erecs'}) if (@recs < 2);
35 &unlock_file(&make_chroot($in{'file'}));
37 # Create zone structure
38 $dir = { 'name' => 'zone',
41 'members' => [ { 'name' => 'type',
42 'values' => [ 'hint' ] },
44 'values' => [ $in{'file'} ] }
49 $conf = &get_config();
50 &create_zone($dir, $conf, $in{'view'});
51 &webmin_log("create", "hint", ".", \%in);