diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 17:04:14 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 17:08:07 -0700 |
commit | 1b11d9a6d33135116f04cb2c270e264dd27aa179 (patch) | |
tree | 2ce2e8fb7ac1ffedd97c041df60931829a7d5afa /scripts | |
parent | 900ce84ea8a12b98c1fc276161504946166950dc (diff) | |
download | vyatta-cfg-qos-1b11d9a6d33135116f04cb2c270e264dd27aa179.tar.gz vyatta-cfg-qos-1b11d9a6d33135116f04cb2c270e264dd27aa179.zip |
Remove sudo from tc commands
No longer need sudo, can just use capabilty.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-qos.pl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index 9655371..30d7c33 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -120,7 +120,7 @@ sub delete_interface { die "bad direction $direction\n" unless $arg; - my $cmd = "sudo tc qdisc del dev $interface ". $arg . " 2>/dev/null"; + my $cmd = "/sbin/tc qdisc del dev $interface ". $arg . " 2>/dev/null"; # ignore errors (may have no qdisc) system($cmd); @@ -167,7 +167,7 @@ sub update_interface { my $out; unless ($debug) { open $out, '|-' - or exec qw:sudo /sbin/tc -batch -: + or exec qw:/sbin/tc -batch -: or die "Tc setup failed: $!\n"; select $out; @@ -281,13 +281,13 @@ sub apply_action{ if ($ingress); # Clear existing ingress - system("sudo tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); - system("sudo tc qdisc add dev $dev handle ffff: ingress") == 0 + system("/sbin/tc qdisc add dev $dev handle ffff: ingress") == 0 or die "tc qdisc ingress failed"; my $cmd = - "sudo tc filter add dev $dev parent ffff:" + "/sbin/tc filter add dev $dev parent ffff:" . " protocol all prio 10 u32" . " match u32 0 0 flowid 1:1" . " action mirred egress $action dev $target"; @@ -299,13 +299,13 @@ sub apply_action{ } # Drop what ever was there before... - system("sudo tc qdisc del dev $dev parent ffff: 2>/dev/null") + system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null") unless($ingress); } sub delete_action { foreach my $dev (@_) { - system("sudo tc qdisc del dev $dev parent ffff: 2>/dev/null"); + system("/sbin/tc qdisc del dev $dev parent ffff: 2>/dev/null"); } } |