Add debug information in gl-pre-git hook
This commit is contained in:
parent
1f52c35bd6
commit
4ae0d9f6e0
1 changed files with 4 additions and 1 deletions
|
@ -9,11 +9,14 @@ use Net::IP;
|
||||||
use ACU::Log;
|
use ACU::Log;
|
||||||
$ACU::Log::log_file = "/var/log/hooks/" . basename($0) . ".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
|
# First, check if the repository is in the YYYY/ directory
|
||||||
exit 0 if ($ENV{GL_REPO} !~ /^2[0-9]{3}\/.+\/.+/);
|
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.";
|
say "Votre IP est : $ip.";
|
||||||
|
|
||||||
$ip = Net::IP->new($ip) or die ("IP invalide");
|
$ip = Net::IP->new($ip) or die ("IP invalide");
|
||||||
|
|
Reference in a new issue