3 # default sleep function
7 # if found and included, this file overwrites loopsleepms()
8 # with a high resolution timer function for precise looping.
9 . "`dirname $0`/loopsleepms.sh.inc"
11 # check if we have a valid number for interval
13 sleep_time=$(( t + 1 - 1 ))
14 if [ "$sleep_time" -eq 0 ]
23 echo "SETCLASSNAME $3 $2"
31 /sbin/tc -s class show dev $x
33 # check FireQOS names for classes
34 if [ ! -z "$fix_names" -a -f /var/run/fireqos/ifaces/$x ]
36 name="`cat /var/run/fireqos/ifaces/$x`"
37 echo "SETDEVICENAME $name"
40 . /var/run/fireqos/$name.conf
41 for n in $interface_classes_monitor
43 setclassname `echo $n | tr '|' ' '`
46 echo "SETDEVICEGROUP $interface_dev"
52 cat /proc/net/dev | grep ":" | cut -d ':' -f 1 | while read dev
54 l=`/sbin/tc class show dev $dev | wc -l`
55 [ $l -ne 0 ] && echo $dev
59 # update devices and class names
60 # once every 2 minutes
61 names_every=$((120 / sleep_time))
63 # exit this script every hour
64 # it will be restarted automatically
65 exit_after=$((3600 / sleep_time))
75 if [ $c -le 1 -o $c -ge $names_every ]
79 devices="`all_devices`"
87 loopsleepms $sleep_time
89 test $gc -gt $exit_after && exit 0