dwun.sourceforge.net QUICKSTART
-------------------------------

Most people will just need to read either section 1) or 2).

Contents:
		1. Debian or RPM package configuration
	    or  2. Tarball configuration

		* Configuring for ISDN
		* Configuring for wvdial

		* Common problem: stuck #Disconnecting

		* More documentation


1. Debian or RPM package configuration
--------------------------------------

Run /usr/sbin/dwunmakeauth with a username as an argument for each user you
wish to add.
e.g.
   dwunmakeauth bob
   dwunmakeauth mary
   dwunmakeauth admin

Edit /etc/dwunrc and check the settings there are correct. (Especially check
that we run the right commandon and commandoff programs.)

RPM users should then run
   /etc/rc.d/init.d/dwun start

Debian users should then run
   /etc/init.d/dwun restart

That's it!


2. Tarball configuration
------------------------

Run
     ./configure
     make
     make install

To create the authfile, run
     dwunmakeauth -i

Run dwunmakeauth (/usr/sbin or /usr/local/sbin) with a username as an argument
for each user you wish to add.

e.g.
   dwunmakeauth bob
   dwunmakeauth mary
   dwunmakeauth admin

Copy doc/examples/minimal-rcfile (in the doc directory) to /etc/dwunrc.
Edit it for your settings.

Edit /etc/ppp/ip-up (or ip-up.local) and add to the start

	# The following line ensures that dwun won't wait for processes launched
	# here to exit before declaring the connection down.
	exec 4>&-

	#CHECKIP=198.186.203.55 # linux.com
	if [ -n "$CHECKIP" ]; then
		CHECKIP="$CHECKIP"
	elif [ -n "$IPREMOTE" ]; then
		CHECKIP="$IPREMOTE"
	elif [ -n "$5" ]; then
		CHECKIP="$5"
	fi
	if [ -n "$CHECKIP" ] && ! ping -c 1 "$CHECKIP"
	then
		#echo '%con:#Bad connection' > /usr/lib/dwun-msg
		kill -USR2 `cat /var/run/dwun.pid`
		exit 1
	fi
	kill -USR1 `cat /var/run/dwun.pid`

Run
   /usr/sbin/dwun
(or /usr/local/sbin/dwun).


ISDN configuration
------------------

Remove the commandoff line from /etc/dwunrc and add the following to the end of the file:

   pre_commandon dwunlog 'ipppd[' /var/log/messages &
   commandon isdnctrl dial ippp0; sleep 10s; if ( /sbin/route -n | grep -q '^0\.0\.0\.0\>' ); then sleep 10000d; fi
   post_commandon isdnctrl hangup ippp0; kill `cat /var/run/dwunlog.pid`
   waitpipe off


Wvdial configuration
--------------------

Run
   touch /var/log/wvdial.log

Remove the commandoff line from /etc/dwunrc and add the following to the end of the file:

   commandon wvdial 2>>/var/log/wvdial.log
   redials 0
   pre_commandon dwunlog /var/log/wvdial.log &
   post_commandon kill `cat /var/run/dwunlog.pid`
   waitpipe off

Please note that when you use wvdial, /etc/ppp/ip-down is *not* run.


Common Problems - stuck #Disconnecting
--------------------------------------

Note that pppd does not create /var/run/pppn.pid until the connection is up. If your commandoff runs the following then you will be stuck #Disconnecting for
a while:
   kill `cat /var/run/ppp0.pid`

When you kill pppd, it says "Exit." in the logs, but it doesn't *really* exit
until all the programs launched in /etc/ppp/ip-up finish.

Ensure that /etc/ppp/ip-up contains
	exec 4>&-
This means that if you launch a daemon in ip-up, dwun won't care about it.

Alternatively, if commandon does not launch a daemon, you can add
   waitpipe off
to /etc/dwunrc.


More documentation
------------------

The HTML documentation is available in the doc/ directory. There are also
several man pages available; dwun(8), dwunmakeauth(8) and dwunrc(5).

The doc directory is
	/usr/share/doc/dwun				for FreeBSD.
	/usr/share/doc/dwun or /usr/doc/dwun		for Debian.
	/usr/doc/dwun-VER-RELEASE			for RPM.
	/usr/local/doc/dwun				for tarball.

The web site is dwun.sourceforge.net and mailing list details are listed there.
