diff --git a/hooks/gl-pre-git b/hooks/gl-pre-git index 581494a..62d352e 100755 --- a/hooks/gl-pre-git +++ b/hooks/gl-pre-git @@ -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");