summaryrefslogtreecommitdiff
path: root/scripts/is_port_available.pl
blob: 52a5ad0fa072162a13b3db41ea2e1ef5a34221b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
# Check to see if the supplied IPv4 or IPv6 address is an existing local address

use strict;
use lib "/opt/vyatta/share/perl5";
use Vyatta::Misc;

my $ip = $ARGV[0];
my $port = $ARGV[1];

if(!defined($ip) || !defined($port) || !is_port_available($ip, $port)) {
    exit 1;
} else {
    exit 0;
}