summaryrefslogtreecommitdiff
path: root/scripts/vyatta-qos-util.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-09-05 15:03:30 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-09-05 15:03:30 -0700
commit200fb453f43a3f0406c14b9003ca5a1e6f7587f4 (patch)
tree02a1a92a6952afabbb861c15f10ef908fa4b5f4a /scripts/vyatta-qos-util.pl
parentdae88a60a1b40555db65f19a417b0600055a4b51 (diff)
downloadvyatta-cfg-qos-200fb453f43a3f0406c14b9003ca5a1e6f7587f4.tar.gz
vyatta-cfg-qos-200fb453f43a3f0406c14b9003ca5a1e6f7587f4.zip
Workaround CLI regex problem
Recent CLI changes seem to have broken working templates that do regex matching. Workaround this by doing the syntax checking all in the perl script Bugfix: 3553
Diffstat (limited to 'scripts/vyatta-qos-util.pl')
-rwxr-xr-xscripts/vyatta-qos-util.pl15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/vyatta-qos-util.pl b/scripts/vyatta-qos-util.pl
index 1e842b8..8c3bafd 100755
--- a/scripts/vyatta-qos-util.pl
+++ b/scripts/vyatta-qos-util.pl
@@ -22,7 +22,10 @@ use lib "/opt/vyatta/share/perl5/";
use VyattaQosUtil;
use Getopt::Long;
+my ($percent, $rate, $burst, $protocol, $dsfield, $time);
+
GetOptions(
+ "percent-or-rate=s" => \$percent,
"rate=s" => \$rate,
"burst=s" => \$burst,
"protocol=s" => \$protocol,
@@ -31,6 +34,15 @@ GetOptions(
"time=s" => \$time,
);
+if ( defined $percent ) {
+ if ($percent =~ /%$/) {
+ my $p = VyattaQosUtil::getPercent($percent);
+ } else {
+ my $r = VyattaQosUtil::getRate($percent);
+ }
+ exit 0;
+}
+
if ( defined $rate ) {
my $r = VyattaQosUtil::getRate($rate);
exit 0;
@@ -57,7 +69,8 @@ if ( defined $time ) {
}
print <<EOF;
-usage: vyatta-qos-util.pl --rate rate
+usage: vyatta-qos-util.pl --percent-or-rate value
+ vyatta-qos-util.pl --rate rate
vyatta-qos-util.pl --time time
vyatta-qos-util.pl --burst size
vyatta-qos-util.pl --protocol protocol