Introduction
------------

This script shows how to have with dwun
	* multiple dial scripts.
	* only one can be running at a time (e.g. multiple providers, single
	modem).
	* users can choose the script they would prefer to have dial.

Caveats
-------

First, decide whether you want all users to be able to decide which connection
to dial. This can be a problem with multiple users dialing around the same time
when they want to use different providers and is handled here on a "first come,
first served" basis. (If someone wants to use a provider, and we're already
connected to a different provider, then tough).

Technique
---------

Have the "username" stand for the provider. Change the provider which is dialed
by running a script with onconnect with the username as an argument.

This enables you to
	* see who's connecting by their IP address in the logs.
	* lock an account to disable dialing a certain provider.
	* limit which provider people are allowed to dial by only giving those
	passwords out to certain people.
	* have time limits for providers in the same way you can for normal
	users.
	* users who are not allowed to change the scripts to be used can have
	ordinary usernames which either don't change the provider we dial, or
	set it to a default value.
	* people choose which provider they wish to use by changing the
	username.

HOWTO
-----

Example: Three providers. Setup the usernames "myisp", "contract" and "backup".
If any other users CONNECT we won't change the provider that is dialed.

Comment out any commandon, commandoff or onconnect commands in /etc/dwunrc and
replace them with
	commandon /usr/bin/multi-connect
	commandoff /usr/bin/multi-disconnect
	onconnect /usr/bin/multi-switch %u

Copy multi-connect, multi-disconnect and multi-switch (in the same directory
as this README) to /usr/bin and chmod 0755 them.

These scripts use the "lockfile" program which is part of the procmail package
(http://www.procmail.org/ or ftp.procmail.org in pub/procmail/). If you do not
wish to use this, comment out the lines starting with "lockfile" and "rm -f".
You *probably* won't have any problems.

Edit multi-connect and multi-disconnect and change the case statements to refer
to "myisp)", "contract)" and "backup)". Insert the commands to connect and
disconnect for each provider into these scripts.

Edit multi-switch and change the case statement so it sets the appropriate
script for each user. Using this simple example, we would have
	case "$USER" in
		myisp)
			ISP="myisp"
			;;
		contract)
			ISP="contract"
			;;
		backup)
			ISP="backup"
			;;
		*)	exit 0 # don't change provider
                	;;
	esac

Of course, if we wanted to, we could have
		mary)
			ISP="contract"
			;;
so that whenever the user called "mary" CONNECT's, the provider is switched to
"contract". Thus the usernames don't have to be the same as the provider names,
but it is a good convention to use.
