supress warnings if ENV not set and be more verbose
This commit is contained in:
parent
92ad9f3fbb
commit
3511cf93ec
@ -50,8 +50,10 @@ if (!defined $server) {
|
|||||||
pod2usage(1);
|
pod2usage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ENV{SSH_CLIENT}=~/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) (\d{1,5}) 22$/) {
|
if(exists $ENV{SSH_CLIENT} &&
|
||||||
|
$ENV{SSH_CLIENT}=~/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) (\d{1,5}) 22$/) {
|
||||||
$ip = $1;
|
$ip = $1;
|
||||||
|
say 'Connection from ', $ip if ($verbose);
|
||||||
} else {
|
} else {
|
||||||
say STDERR "cannot pare remote IP";
|
say STDERR "cannot pare remote IP";
|
||||||
pod2usage(1);
|
pod2usage(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user