@cryptotaxi247 / netdata-1 / commits / 1bc573ed8

prevent forks in tc-qos-helper.sh

Costa Tsaousis committed Jul 2, 2016 at 00:24 UTC 1bc573ed8c15569cd8605c99d906d060d6c85425
1 file changed +5 -4
plugins.d/tc-qos-helper.sh
+5 -4
@@ -58,7 +58,7 @@ setclassname() {
58 }
59
60 show_tc() {
61 - local x="${1}"
61 + local x="${1}" interface_dev interface_classes interface_classes_monitor
62
63 echo "BEGIN ${x}"
64 ${tc} -s class show dev ${x}
@@ -66,17 +66,18 @@ show_tc() {
66 # check FireQOS names for classes
67 if [ ! -z "${fix_names}" -a -f "${fireqos_run_dir}/ifaces/${x}" ]
68 then
69 - name="$(cat "${fireqos_run_dir}/ifaces/${x}")"
69 + name="$(<"${fireqos_run_dir}/ifaces/${x}")"
70 echo "SETDEVICENAME ${name}"
71
72 + interface_dev=
73 interface_classes=
74 interface_classes_monitor=
75 source "${fireqos_run_dir}/${name}.conf"
76 for n in ${interface_classes_monitor}
77 do
77 - setclassname $(echo ${n} | tr '|' ' ')
78 + setclassname ${n//|/ }
79 done
79 - echo "SETDEVICEGROUP ${interface_dev}"
80 + [ ! -z "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}"
81 fi
82 echo "END ${x}"
83 }