timecheck_fix.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- htb.init.old 2004-01-29 22:41:23.000000000 +0100
  2. +++ htb.init 2006-09-08 00:11:36.000000000 +0200
  3. @@ -891,7 +895,6 @@
  4. TIME_TMP=`date +%w/%k:%M`
  5. TIME_DOW=${TIME_TMP%%/*}
  6. TIME_NOW=${TIME_TMP##*/}
  7. -TIME_ABS=`htb_time2abs $TIME_NOW`
  8. ### Check all classes (if configured)
  9. for classfile in `htb_class_list`; do
  10. @@ -914,6 +917,7 @@
  11. ### Compute interval boundaries
  12. BEG_ABS=`htb_time2abs $BEG_TIME`
  13. END_ABS=`htb_time2abs $END_TIME`
  14. + TIME_ABS=`htb_time2abs $TIME_NOW`
  15. ### Midnight wrap fixup
  16. if [ $BEG_ABS -gt $END_ABS ]; then
  17. @@ -926,6 +930,23 @@
  18. ### If time period matches, remember params and set MATCH flag
  19. if [ $TIME_ABS -ge $BEG_ABS -a $TIME_ABS -lt $END_ABS ]; then
  20. RATESPEC=${PARAMS%%,*}; CEILSPEC=${PARAMS##*,}
  21. +
  22. + RNAME=""; CNAME=""
  23. +
  24. + [ "$RATESPEC" = "prate" ] && RNAME=RATE_$PARENT
  25. + [ "$RATESPEC" = "pceil" ] && RNAME=CEIL_$PARENT
  26. +
  27. + if [ -n "$RNAME" ]; then
  28. + RATESPEC=${!RNAME}
  29. + fi
  30. +
  31. + [ "$CEILSPEC" = "prate" ] && CNAME=RATE_$PARENT
  32. + [ "$CEILSPEC" = "pceil" ] && CNAME=CEIL_$PARENT
  33. +
  34. + if [ -n "$CNAME" ]; then
  35. + CEILSPEC=${!CNAME}
  36. + fi
  37. +
  38. [ "$RATESPEC" = "$CEILSPEC" ] && CEILSPEC=""
  39. NEW_RATE=${RATESPEC%%/*}; NEW_BURST=${RATESPEC##*/}