#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

DEVICE=`basename $0`

# reset all rules
isdnctrl flushallrules $DEVICE

# any IP traffic sets timeout to 60 secs
isdnctrl default $DEVICE keepup both 60

# first we ensure triggering dialing is not allowed
isdnctrl default $DEVICE bringup 0

# rules to bring the link up (having wwwoffle in autodial mode)
isdnctrl addrule $DEVICE bringup 2 ip/tcp 0/0 - 0/0 20-23	# FTP, Telnet
isdnctrl addrule $DEVICE bringup 2 ip/tcp 0/0 - 0/0 80		# WWW
isdnctrl addrule $DEVICE bringup 2 ip/tcp 0/0 - 0/0 6667-6669	# IRC

# FTP, IRC and Telnet always raise the timeout to 300 secs
isdnctrl addrule $DEVICE keepup both 300 ip/tcp 0/0 20-23 0/0 -	# FTP,Telnet
isdnctrl addrule $DEVICE keepup both 300 ip/tcp 0/0 80 0/0 -    # IRC
