#!/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 CABLE provider
#

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


# Paths to programs
START=/usr/sbin/cable-start
STOP=/usr/sbin/cable-stop
STATUS=/usr/sbin/cable-status
case "$1" in
    start)
        echo -n "Bringing up CABLE link: "

	$START
	if [ $? = 0 ] ; then
		echo success
		touch /var/lock/subsys/cable
	else
		echo failure
	fi
        ;;

    stop)
        echo -n "Shutting down CABLE link: "

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

    restart)
	$0 stop
	$0 start
	;;

    status)
	$STATUS
	;;

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

exit 0
