Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 3b7f5c380cd7141db24d54d6239e6137 > files > 5

wondershaper-1.1a-7mdv2009.0.src.rpm

#!/bin/sh
#
# chkconfig: 2345 80 20
# description: Helps maintain interactive latency on modem/ADSL/cable

# Source function library.
. /etc/rc.d/init.d/functions

#wondershaper="/usr/sbin/wshaper"
wondershaper="/usr/sbin/wshaper.htb"

name="Wonder Shaper"

RETVAL=0

start() {
    gprintf "Starting %s: " "$name"
    "$wondershaper" start
    RETVAL=$?
    [ $RETVAL == 0 ] && success "stop" || failure "stop"
    echo
    return $RETVAL
}

stop() {
    gprintf "Stopping %s: " "$name"
    "$wondershaper" stop
    RETVAL=$?
    [ $RETVAL == 0 ] && success "stop" || failure "stop"
    echo
    return $RETVAL
}

status() {
    "$wondershaper" status
    RETVAL=$?
    return $RETVAL
}

case "$1" in
        start)
            start
            ;;

        stop)
            stop
            ;;

        restart)
            stop
            start
            ;;

        status)
            status
            ;;

        *)
            gprintf "Usage: %s {start|stop|restart|status}\n" "$0"
            exit 1

esac

exit $REVAL