Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
etc
/
rc3.d
/
Upload File :
New :
File
Dir
//proc/self/root/etc/rc3.d/S08ratelimit
#!/bin/sh # # ratelimit: Starts up TC Rate limiting, independent of # queueing disciple. # chkconfig: 2345 08 92 # description: Starts and stops rate limiting # # config: /etc/sysconfig/tc_config # Source function library. . /etc/init.d/functions TC=tc TC_CONFIG=/etc/sysconfig/tc_config if [ ! -x /sbin/$TC ] ; then echo -n $"/sbin/$TC does not exist."; warning; echo exit 0 fi # no protocol support, don't try to run if [ ! -d /proc/sys/net/ipv4 ]; then exit 0 fi # Ensure there's a configuration file. if [ ! -e $TC_CONFIG ] ; then echo -n $"no rules defined in $TC_CONFIG."; warning; echo exit 0 fi ret=1 case $1 in start) echo -n "Starting Rate Limiting: " $TC -b $TC_CONFIG ret=$? [ $ret -eq 0 ] && success || failure echo ;; stop) echo -n "Stopping Rate Limiting: " ret=0 for i in `/sbin/ifconfig | grep eth | awk '{print $1}'`; do if [ -z "`/sbin/$TC qdisc list dev $i | grep pfifo_fast`" ] ; then /sbin/$TC qdisc del dev $i root 2> /dev/null let ret=$ret+$? fi done [ $ret -eq 0 ] && success || failure echo ;; restart) $0 stop $0 start ;; status) $TC -s -d qdisc list ;; *) echo "Usage: $0 [start|stop|restart|status]" ret=1 ;; esac exit $ret