mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
qos: Avoid stats to be reseted on qos reload
This commit is contained in:
parent
6214cbb4e7
commit
3eb4b07880
1 changed files with 40 additions and 0 deletions
|
|
@ -13,7 +13,35 @@ PROG=/usr/sbin/qosmngr
|
|||
. /lib/functions.sh
|
||||
include /lib/qos
|
||||
|
||||
#function to handle a policer section
|
||||
qos_reload_handler() {
|
||||
qos_mechanism_handler() {
|
||||
config_get cfgtype "$1" TYPE
|
||||
echo $cfgtype
|
||||
|
||||
if [ "$cfgtype" == "shaper" ]; then
|
||||
reload_qos $cfgtype
|
||||
elif [ "$cfgtype" == "classify" ]; then
|
||||
reload_qos $cfgtype
|
||||
elif [ "$cfgtype" == "policer" ]; then
|
||||
reload_qos $cfgtype
|
||||
elif [ "$cfgtype" == "queue" ]; then
|
||||
restart
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
config_load "/tmp/qos_config_diff"
|
||||
config_foreach qos_mechanism_handler
|
||||
}
|
||||
|
||||
|
||||
start_service() {
|
||||
if [ ! -f "/tmp/qos_config" ]; then
|
||||
touch /tmp/qos_config
|
||||
cp /etc/config/qos /tmp/qos_config
|
||||
fi
|
||||
|
||||
if [ -f "/etc/config/qos" ]; then
|
||||
reload_qos
|
||||
procd_open_instance qosmngr
|
||||
|
|
@ -37,3 +65,15 @@ restart() {
|
|||
setup_qos
|
||||
start
|
||||
}
|
||||
|
||||
reload_service()
|
||||
{
|
||||
if [[ -f "/etc/config/qos" && -f "/tmp/qos_config" ]]; then
|
||||
awk 'NR==FNR{a[FNR]=$0;next}$0!=a[FNR]{print}' /tmp/qos_config /etc/config/qos > /tmp/qos_config_diff
|
||||
cp /etc/config/qos /tmp/qos_config
|
||||
if [[ ! -z "/tmp/qos_config_diff" ]]; then
|
||||
qos_reload_handler
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue