A new user interface for you! Read more...

File rcwondershaper of Package wondershaper

#! /bin/sh
# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Henne Vogelsang <feedback@suse.de>
#
# /etc/init.d/wondershaper
#   and its symbolic link
# /usr/sbin/rcwondershaper
#
# System startup script for wondershaper
#
### BEGIN INIT INFO
# Provides:          wondershaper
# Required-Start:    $syslog $remote_fs $network
# Required-Stop:     $syslog $remote_fs $network
# Default-Start:     2 3 5
# Default-Stop:      0 1 6
# Short-Description: wondershaper providing QOS
# Description:       Start wondershaper to provide quality of service
### END INIT INFO

. /etc/rc.status
test -f /etc/sysconfig/wondershaper && . /etc/sysconfig/wondershaper

# Check for missing binaries (stale symlinks should not happen)
case "${WSHAPER_QDISC_TYPE}" in
	htb) WSHAPER_BIN="/usr/sbin/wshaper.htb" ;;
	cbq|*)   WSHAPER_BIN="/usr/sbin/wshaper.cbq" ;;
esac
test -x $WSHAPER_BIN || exit 5

# Reset status of this service
rc_reset

case "$1" in
    start)
        echo -n "Starting wondershaper "

	WSHAPER_START_OUT=`$WSHAPER_BIN start 2>&1`

        # Remember status and be verbose
        rc_status -v

        if [ -n "$WSHAPER_START_OUT" ]
        then
		echo "$WSHAPER_START_OUT"
        fi
        ;;
    stop)
        echo -n "Shutting down wondershaper "

        $WSHAPER_BIN stop > /dev/null 2>&1

        # Remember status and be verbose
        rc_status -v
        ;;
    try-restart)

        $0 status >/dev/null &&  $0 restart

        # Remember status and be quiet
        rc_status
        ;;
    restart)
        
	$0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        echo -n "Reload service wondershaper "
        $0 stop  &&  $0 start
        rc_status
        ;;
    reload)
        echo -n "Reload service wondershaper "
        rc_failed 3
        rc_status -v
        ;;
    status)
        echo -n "Checking for service wondershaper "

        WSHAPER_STATUS=`$WSHAPER_BIN status 2>&1`

		case $WSHAPER_STATUS in
					*pfifo_fast*)
	                			rc_failed 3
						rc_status -v
					;;
                                        *sysconfig*)
                                                rc_failed 3
                                                rc_status -v
                                        ;;
					*)
        	        			rc_failed 0
                				rc_status -v
		if [ "$WSHAPER_VERBOSE_STATUS" = "true" ]
		then
			echo "$WSHAPER_STATUS"
		fi	
		esac
        ;;
    *)
        echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
        exit 1
        ;;
esac
rc_exit