Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion server/bin/nt_import.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'file=s' => \my $filename,
'user=s' => \my $nt_user,
'pass=s' => \my $nt_pass,
'use-https' => \my $nt_https,
'type=s' => \my $type,
'verbose' => \my $verbose,
'help' => \my $help,
Expand All @@ -38,6 +39,7 @@
print " --type Import type (tinydns or bind)\n";
print " --file File to import data from (data for tinydns, named.conf for bind)\n";
print " --group_id NicTool group id zones are placed into\n";
print " --use-https Use https towards NicTool Server\n";
print " --verbose Show extra messages verbose\n\n";
print "Report issues at https://github.com/msimerson/NicTool/issues\n";
exit 0;
Expand All @@ -49,7 +51,7 @@

my $nti;
$type ||= get_type(); load_type($type);
my $nt = $nti->nt_connect($nt_host, $nt_port, $nt_user, $nt_pass);
my $nt = $nti->nt_connect($nt_host, $nt_port, $nt_user, $nt_pass, $nt_https);

$group_id ||= $nt->result->{store}{nt_group_id} || die "unable to get group ID\n";
warn Dumper($nt->result->{store}) if $verbose;
Expand Down
4 changes: 3 additions & 1 deletion server/lib/NicToolServer/Import/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sub new {
nt_pass => undef,
group_id => undef,
nameservers => undef,
nt_https => 0,
}, $class;
return $self;
};
Expand Down Expand Up @@ -279,7 +280,7 @@ sub nt_get_zone_records {
}

sub nt_connect {
my ($self, $nt_host, $nt_port, $nt_user, $nt_pass) = @_;
my ($self, $nt_host, $nt_port, $nt_user, $nt_pass, $nt_https) = @_;

return $self->{nt} if $self->{nt};

Expand All @@ -298,6 +299,7 @@ sub nt_connect {
my $nt = NicTool->new(
server_host => $nt_host || '127.0.0.1',
server_port => $nt_port || 8082,
transfer_protocol => $nt_https ? 'https' : 'http',
#protocol => 'xml_rpc', # or soap
);

Expand Down