This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2014-01-25 18:49:58 +01:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use v5.14;
|
|
|
|
use autodie;
|
|
|
|
use Modern::Perl;
|
2014-03-04 00:45:33 +01:00
|
|
|
use Net::OpenSSH;
|
2014-01-25 18:49:58 +01:00
|
|
|
|
2014-03-04 00:45:33 +01:00
|
|
|
my $hostname = "ns0.arn-fai.net";
|
|
|
|
my $username = "dnsmanager";
|
2014-01-25 18:49:58 +01:00
|
|
|
|
2014-03-04 00:45:33 +01:00
|
|
|
my $co = "$username\@$hostname:2222";
|
2014-01-25 18:49:58 +01:00
|
|
|
|
2014-03-04 00:45:33 +01:00
|
|
|
say $co;
|
|
|
|
|
|
|
|
my $ssh = Net::OpenSSH->new($co);
|
|
|
|
$ssh->scp_put("tpl.zone", "/home/$username/") or die "scp failed: " . $ssh->error;
|
|
|
|
|
|
|
|
#use Net::SCP; # ne fonctionne pas avec des ports :/
|
|
|
|
#my $scp = Net::SCP->new( { host => $hostname, user => $username, port => 2222} );
|
|
|
|
#$scp->put("tpl.zone", "lolwat") or die $scp->{errstr};
|
2014-01-25 18:49:58 +01:00
|
|
|
# $scp->put("filename") or die $scp->{errstr};
|