summaryrefslogtreecommitdiff
path: root/scripts/bgp/vyatta-bgp.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bgp/vyatta-bgp.pl')
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl22
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;
+}