diff options
Diffstat (limited to 'scripts/bgp/vyatta-bgp.pl')
-rwxr-xr-x | scripts/bgp/vyatta-bgp.pl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl new file mode 100755 index 00000000..d20ad8fa --- /dev/null +++ b/scripts/bgp/vyatta-bgp.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl +use lib "/opt/vyatta/share/perl5/"; +use VyattaMisc; +use Getopt::Long; + +GetOptions("check-peer-name=s" => \$peername, +); + +if (defined $peername) { check_peer_name($peername); } + +exit 0; + +sub check_peer_name() { + my $neighbor = shift; + + $_ = $neighbor; + if ((! isIpAddress("$neighbor")) && (/[\s\W]/g)) { + print "malformed neighbor address $neighbor\n"; + exit 1; + } + exit 0; +} |