📄 create_forward.cgi
字号:
#!/usr/local/bin/perl# create_forward.cgi# Create a new forward zonerequire './bind8-lib.pl';&ReadParse();&error_setup($text{'fcreate_err'});%access = &get_module_acl();$access{'forward'} || &error($text{'fcreate_ecannot'});$access{'ro'} && &error($text{'master_ero'});# validate inputsif ($in{'rev'}) { $in{'zone'} =~ /^[0-9\.]+$/ || &error(&text('fcreate_enet', $in{'zone'})); $in{'zone'} = &ip_to_arpa($in{'zone'}); }else { $in{'zone'} =~ /^[A-z0-9\-\.]+$/ || &error(&text('fcreate_edom', $in{'zone'})); }$in{'zone'} =~ s/\.$//g;@masters = split(/\s+/, $in{'masters'});foreach $m (@masters) { &check_ipaddress($m) || &error(&text('fcreate_emaster', $m)); }if (!@masters) { &error($text{'fcreate_enone'}); }# Create zone directiveopen(CONF, ">> $config{'named_conf'}");print CONF "zone \"$in{'zone'}\" {\n";print CONF "\ttype forward;\n";print CONF "\tforwarders {\n";foreach $m (@masters) { print CONF "\t\t$m;\n"; }print CONF "\t\t};\n";print CONF "\t};\n";print CONF "\n";close(CONF);# Add the new zone to the access listif ($access{'zones'} ne '*') { $access{'zones'} .= " ".$in{'zone'}; &save_module_acl(\%access); }&redirect("");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -