#! /bin/sh
#
# This file was automatically customized by debmake on Tue, 27 Jan 1998 17:06:28 -0800
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/frad
# The following value is extracted by debstd to figure out how to generate
# the postinst script. Edit the field to change the way the script is
# registered through update-rc.d (see the manpage for update-rc.d!)
FLAGS="defaults 14"

test -f $DAEMON || exit 0

case "$1" in
  start)
	echo -n "Starting Frame Relay Device:"
#	insmod dlci
#	indmod sdla
	frad -Q /etc/frad.conf
	dlcicfg -Q file /etc/frad.conf
	ifconfig sdla0 up
#	ifconfig dlci00 route-cap pointopoint cap-T1-ilc netmask 255.255.255.128 up
#	ifconfig dlci01 route-cap pointopoint cap-T1-ilc netmask 255.255.255.128 up
#	route add cap-t1-ilc dev dlci00
#	route add default dev dlci01 source linux.org
#	route add default dev dlci00

	touch /var/run/frad
	echo "frad"
    ;;
  stop)
	echo -n "Stopping Frame Relay Device:"
	ifconfig sdla0 down
#	route del default
#	route del cap-T1-ilc
	ifconfig sdla0 down
#	ifconfig dlci00 down
#	ifconfig dlci01 down
#	dlcicfg del dlci00
#	dlcicfg del dlci01
#	rmmod sdla
#	rmmod dlci

	rm /var/run/frad
	echo "frad"
    ;;
  *)
    echo "Usage: /etc/init.d/frad {start|stop}"
    exit 1
    ;;
esac

exit 0
