From: Michael Tremer Date: Thu, 10 Jun 2021 13:45:27 +0000 (+0100) Subject: qos.cgi: Use new perl system functions X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=5b8ecec9e8ff95251397ec057881859e3a36eef8 qos.cgi: Use new perl system functions Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index db75914737..fa566b5238 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -232,7 +232,7 @@ END open( FILE, "< $level7file" ) or die "Unable to read $level7file"; @l7rules = ; close FILE; - system("rm $level7file"); + &General::system("rm", "$level7file"); foreach $l7ruleentry (sort @l7rules) { @l7ruleline = split( /\;/, $l7ruleentry ); @@ -244,13 +244,13 @@ END close FILE; } } - open( FILE, "< $level7file" ) or system("touch $level7file");close FILE; + open( FILE, "< $level7file" ) or &General::system("touch", "$level7file");close FILE; } elsif ($qossettings{'DOLEVEL7'} eq $Lang::tr{'edit'}) { open( FILE, "< $level7file" ) or die "Unable to read $level7file"; @l7rules = ; close FILE; - system("rm $level7file"); + &General::system("rm", "$level7file"); foreach $l7ruleentry (sort @l7rules) { @l7ruleline = split( /\;/, $l7ruleentry ); @@ -263,7 +263,7 @@ END } } &level7rule; - open( FILE, "< $level7file" ) or system("touch $level7file");close FILE; + open( FILE, "< $level7file" ) or &General::system("touch", "$level7file");close FILE; } ############################################################################################################################ @@ -323,7 +323,7 @@ END open( FILE, "< $portfile" ) or die "Unable to read $portfile"; @portrules = ; close FILE; - system("rm $portfile"); + &General::system("rm", "$portfile"); foreach $portruleentry (sort @portrules) { @portruleline = split( /\;/, $portruleentry ); @@ -336,7 +336,7 @@ END } } &portrule; - open( FILE, "< $portfile" ) or system("touch $portfile");close FILE; + open( FILE, "< $portfile" ) or &General::system("touch", "$portfile");close FILE; } ############################################################################################################################ @@ -408,25 +408,25 @@ if ($qossettings{'ACTION'} eq $Lang::tr{'start'}) { $qossettings{'ENABLED'} = 'on'; &General::writehash("${General::swroot}/qos/settings", \%qossettings); - system("/usr/local/bin/qosctrl generate >/dev/null 2>&1"); - system("/usr/local/bin/qosctrl start >/dev/null 2>&1"); - system("logger -t ipfire 'QoS started'"); + &General::system("/usr/local/bin/qosctrl", "generate"); + &General::system("/usr/local/bin/qosctrl", "start"); + &General::system("logger", "-t", "ipfire", "QoS started"); } elsif ($qossettings{'ACTION'} eq $Lang::tr{'stop'}) { $qossettings{'ENABLED'} = 'off'; &General::writehash("${General::swroot}/qos/settings", \%qossettings); - system("/usr/local/bin/qosctrl stop >/dev/null 2>&1"); - system("/usr/local/bin/qosctrl generate >/dev/null 2>&1"); - system("logger -t ipfire 'QoS stopped'"); + &General::system("/usr/local/bin/qosctrl", "stop"); + &General::system("/usr/local/bin/qosctrl", "generate"); + &General::system("logger", "-t", "ipfire", "QoS stopped"); } elsif ($qossettings{'ACTION'} eq $Lang::tr{'restart'}) { if ($qossettings{'ENABLED'} eq 'on'){ - system("/usr/local/bin/qosctrl stop >/dev/null 2>&1"); - system("/usr/local/bin/qosctrl generate >/dev/null 2>&1"); - system("/usr/local/bin/qosctrl start >/dev/null 2>&1"); - system("logger -t ipfire 'QoS restarted'"); + &General::system("/usr/local/bin/qosctrl", "stop"); + &General::system("/usr/local/bin/qosctrl", "generate"); + &General::system("/usr/local/bin/qosctrl", "start"); + &General::system("logger", "-t", "ipfire", "QoS restarted"); } } elsif ($qossettings{'ACTION'} eq $Lang::tr{'save'}) @@ -530,9 +530,9 @@ END $qossettings{'ACK'} ="101"; $qossettings{'ENABLED'} = 'on'; &General::writehash("${General::swroot}/qos/settings", \%qossettings); - system("/usr/local/bin/qosctrl generate >/dev/null 2>&1"); - system("/usr/local/bin/qosctrl start >/dev/null 2>&1"); - system("logger -t ipfire 'QoS started'"); + &General::system("/usr/local/bin/qosctrl", "generate"); + &General::system("/usr/local/bin/qosctrl", "start"); + &General::system("logger", "-t", "ipfire", "QoS started"); } else { $message = $Lang::tr{'qos enter bandwidths'}; }