Erro com cbqinit quando tento executar cbq.init timecheck

Iniciado por marcio, 11 de Setembro de 2006, 18:16

tópico anterior - próximo tópico

marcio

Estou tentando configura o cbqinit no meu pc mas estou tendo dificuldades. Se Alguem puder me ajudar agradeceria

Essa e  parte no script que executa o timecheck

timecheck)

### Get time + weekday
TIME_TMP=`date +%w/%k:%M`
TIME_DOW=${TIME_TMP%%/*}
TIME_NOW=${TIME_TMP##*/}
TIME_ABS=`cbq_time2abs $TIME_NOW`

### Load DEVICES, DEVFIELDS and CLASSLIST
cbq_init $CBQ_PATH

### Run through all classes
for classfile in $CLASSLIST; do
   ### Gather all TIME rules from class config
   TIMESET=`sed -n 's/#.*//; s/[[:space:]]//g; /^TIME/ { s/.*=//; p; }' \
      $CBQ_PATH/$classfile`
   [ -z "$TIMESET" ] && continue

   MATCH=0; CHANGE=0
   for timerule in $TIMESET; do
      ### Split TIME rule to pieces
      TIMESPEC=${timerule%%;*}; PARAMS=${timerule##*;}
      WEEKDAYS=${TIMESPEC%%/*}; INTERVAL=${TIMESPEC##*/}
      BEG_TIME=${INTERVAL%%-*}; END_TIME=${INTERVAL##*-}

      ### Check the day-of-week (if present)
      [ "$WEEKDAYS" != "$INTERVAL" -a \
        -n "${WEEKDAYS##*$TIME_DOW*}" ] && continue

      ### Compute interval boundaries
      BEG_ABS=`cbq_time2abs $BEG_TIME`
      END_ABS=`cbq_time2abs $END_TIME`

      ### Midnight wrap fixup
      if [ $BEG_ABS -gt $END_ABS ]; then
         [ $TIME_ABS -le $END_ABS ] &&
            TIME_ABS=$[TIME_ABS + 24*60]

         END_ABS=$[END_ABS + 24*60]
      fi

      ### If the time matches, remember params and set MATCH flag
      if [ $TIME_ABS -ge $BEG_ABS -a $TIME_ABS -lt $END_ABS ]; then
         TMP_RATE=${PARAMS%%/*}; PARAMS=${PARAMS#*/}
         TMP_WGHT=${PARAMS%%/*}; TMP_PEAK=${PARAMS##*/}

         [ "$TMP_PEAK" = "$TMP_WGHT" ] && TMP_PEAK=""
         TMP_PEAK=${TMP_PEAK:+peakrate $TMP_PEAK}

         MATCH=1
      fi
   done ### timerule


   cbq_load_class $CBQ_PATH $classfile

   ### Get current RATE of CBQ class
   RATE_NOW=`tc class show dev $DEVICE| sed -n \
       "/cbq 1:$CLASS / { s/.*rate //; s/ .*//; p; q; }"`
   [ -z "$RATE_NOW" ] && continue

   ### Time interval matched
   if [ $MATCH -ne 0 ]; then

      ### Check if there is any change in class RATE
      if [ "$RATE_NOW" != "$TMP_RATE" ]; then
         NEW_RATE="$TMP_RATE"
         NEW_WGHT="$TMP_WGHT"
         NEW_PEAK="$TMP_PEAK"
         CHANGE=1
      fi

   ### Match not found, reset to default RATE if necessary
   elif [ "$RATE_NOW" != "$RATE" ]; then
      NEW_WGHT="$WEIGHT"
      NEW_RATE="$RATE"
      NEW_PEAK="$PEAK"
      CHANGE=1
   fi

   ### If there are no changes, go for next class
   [ $CHANGE -eq 0 ] && continue

   ### Replace CBQ class
   tc class replace dev $DEVICE classid 1:$CLASS cbq \
   bandwidth $BANDWIDTH rate $NEW_RATE weight $NEW_WGHT prio $PRIO \
   allot 1514 cell 8 maxburst 20 avpkt 1000 $BOUNDED $ISOLATED

   ### Replace leaf qdisc (if any)
   if [ "$LEAF" = "tbf" ]; then
      tc qdisc replace dev $DEVICE handle $CLASS tbf \
      rate $NEW_RATE buffer $BUFFER limit $LIMIT mtu $MTU $NEW_PEAK
   fi

   cbq_message "$TIME_NOW: class $CLASS on $DEVICE changed rate ($RATE_NOW -> $NEW_RATE)"
done ### class file
;;

Ja tentei encontrar o erro mas nao achei.

find: warning: you have specified the -maxdepth opition after a non-option argument -type, but options arenot position (-maxdepth affects tests specified defore it as well as those specified after it.) please specify opitions before other arguments

Esse é o erro que aparece quando tento executar o comando.

Marcio