File: git_with_password.pl

package info (click to toggle)
libnet-openssh-perl 0.84-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: perl: 3,410; makefile: 2
file content (27 lines) | stat: -rwxr-xr-x 533 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

use strict;
use warnings;

use Net::OpenSSH;

@ARGV or die <<EOU;
Usage:
  $0 <ssh_target> <git_command> [<arg1> [<arg2> [...]]]

For instance:
  $0 kkabuto:sayaka\@mazingerz.pplab.or.jp clone ssh://kkabuto\@mazingerz.pplab.or.jp/home/kkabuto/pilder-linux

EOU

my $target = shift @ARGV; # password:user@host

my $ssh = Net::OpenSSH->new($target);
$ssh->die_on_error("Unable to connect to $target");

$ENV{GIT_SSH} = 'git_ssh_through_mux.pl';
$ENV{SSH_MUX} = $ssh->get_ctl_path;

system 'env';

system git => @ARGV;