diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-01 13:14:31 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-10-01 13:14:31 -0700 |
commit | cfa368bbc1d4c55c42c60838e04fc523625932b7 (patch) | |
tree | e439217d7e3ebb726b9954d7f823db2b47f18c9d /scripts/bgp/vyatta-bgp.pl | |
download | vyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.tar.gz vyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.zip |
initial import (from eureka /cli).upstream
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; +} |