Archived
1
0
Fork 0

Add debug information in gl-pre-git hook

This commit is contained in:
Mercier Pierre-Olivier 2013-09-30 10:53:21 +02:00
parent 1f52c35bd6
commit 4ae0d9f6e0

View file

@ -9,11 +9,14 @@ use Net::IP;
use ACU::Log;
$ACU::Log::log_file = "/var/log/hooks/" . basename($0) . ".log";
my $ip = $1 if ($ENV{'SSH_CLIENT'} =~ m/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/);
log DEBUG, "Connection to $ENV{GL_REPO} from $ip";
# First, check if the repository is in the YYYY/ directory
exit 0 if ($ENV{GL_REPO} !~ /^2[0-9]{3}\/.+\/.+/);
my $ip = $1 if ($ENV{'SSH_CLIENT'} =~ m/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/);
say "Votre IP est : $ip.";
$ip = Net::IP->new($ip) or die ("IP invalide");