summaryrefslogtreecommitdiff
path: root/scripts/policy/vyatta-check-as-prepend.pl
blob: ba2c4f3ebf53487527d64af64cf4383637241d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl
use strict;

my @as_list = split( ' ', $ARGV[0] );
foreach my $as (@as_list) {
    exit 1 if ( $as =~ /[^\d\s]/ || $as < 1 || $as > 4294967294 );
}

die "Error: max 24 as path\n" if ( scalar(@as_list) > 24 );

exit 0;