Skip to content

Instantly share code, notes, and snippets.

@Kappaton
Created February 16, 2018 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kappaton/6e75c1e3f5c8fa3b4e505b8e032dce57 to your computer and use it in GitHub Desktop.
Save Kappaton/6e75c1e3f5c8fa3b4e505b8e032dce57 to your computer and use it in GitHub Desktop.
#!/bin/perl -w -
use warnings;
use strict;
use IO::Socket::INET;
if (@ARGV < 3){
die "USAGE: perl Confirmation_Port.pl [HOST] [PORT] [PROTO]\n";
exit;
}
my $sock = IO::Socket::INET->new(
PeerAddr=>$ARGV[0],
PeerPort=>$ARGV[1],
Proto=>$ARGV[2],
Timeout=>5,
) or die "Close $ARGV[1]\/$ARGV[2] port!\n";
if ($sock){
print "Open $ARGV[1]\/$ARGV[2] port!\n";
} else {
print "Error!\n";
}
@Kappaton
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment