#!/bin/sh
#Made by Marcelo A.
#All Credits reserved to Marcelo A. nickname (Zap-W) , Copyrighted.

# cable                    This script starts or stops an CABLE connection
#
# description: Connects to ADSL provider
#

# Source function library if it exists
test -r /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions

START=/usr/sbin/sth-start
STOP=/usr/sbin/sth-stop
STATUS=/usr/sbin/sth-status
case "$1" in
    start)
        echo -n "Bringing up ADSL link"

	$START
	if [ $? = 0 ] ; then
		touch /var/lock/subsys/cable
	        echo_success
	else
		echo_failure
	fi
        echo ""
        ;;

    stop)
        echo -n "Shutting down ADSL link"

	$STOP > /dev/null 2>&1
	if [ $? = 0 ] ; then
		rm -f /var/lock/subsys/cable
	        echo_success
	else
		echo_failure
	fi
        echo ""
        ;;

    restart)
	$0 stop
	$0 start
	;;

    status)
	$STATUS
	;;

    *)
        echo "Usage: cable start|stop|restart|status}"
        exit 1
esac

exit 0
