Commit 255394a9 authored by Nigel Kukard's avatar Nigel Kukard

Don't wait for connection failure from port knocking

parent 79088b67
......@@ -569,11 +569,10 @@ if (defined($kwalletObject) && defined($kwalletHandle)) {
# Check if we need to do port knocking
if (defined($knockHost)) {
if (defined($knockPort)) {
# Make sure we have a port knocking port
if (!defined($knockPort)) {
logger('ERROR',color('bold red')."No port knocking port defined!".color('reset'));
exit 1;
if (!defined($knockHost)) {
$knockHost = $loginHost;
}
logger('NOTICE',"Port knocking '".color('green')."%s".color('reset')."' on port '".color('green')."%s".color('reset')."'...",
......@@ -585,13 +584,6 @@ if (defined($knockHost)) {
Proto => 'tcp',
Timeout => 3
);
# We should get a failure of "Connection refused", if not ERR
if (defined($sock) || $! ne "Connection refused") {
logger('ERROR',color('bold red')."Port knocking failed!".color('reset'));
exit 1;
}
logger('INFO',"Port knocking success!");
print STDERR "\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment