#!/bin/sh
exit 1

DEVICE="$1"

case "$1" in
    start)
	do_isdnctrl $DEVICE
	ifconfig ${DEVICE} ${LOCAL_IP} pointopoint ${REMOTE_IP} allmulti -arp
	route add -host ${REMOTE_IP} dev ${DEVICE}
	route add default gw ${REMOTE_IP} ${DEVICE}

	;;
    stop)
	isdnctrl hangup ${DEVICE}
	ifconfig ${DEVICE} down
	isdnctrl delif ${DEVICE}
	;;
    hangup)
	isdnctrl hangup ${DEVICE}
	;;
    *)
	echo "Usage: /etc/r2d2/isdn {start|stop|hangup}"
	exit 1
	;;
esac